|
-
Mar 13th, 2006, 08:36 AM
#1
Thread Starter
Fanatic Member
Microsoft Excel macro - "SELECT CASE" Statements
I need to do some validation on an Excel file that I have. Rather than type the longest "IF" formula known to man into the formula bar, I'd like to create my statements in the VB Code window.
That way I can basically use VB syntax and make things easier to read.
So if I want an IF statement in Cell C6 how would I go about doing so?
-
Mar 13th, 2006, 08:57 AM
#2
Re: Microsoft Excel macro - "SELECT CASE" Statements
Code:
sht.cells(3,1)="=if(......)"
sht is the active sheet or worksheet you specify.
alternatively
Code:
if sht.cells(3,1)="...." then
end if
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Mar 13th, 2006, 09:08 AM
#3
Thread Starter
Fanatic Member
Re: Microsoft Excel macro - "SELECT CASE" Statements
So could you do something like this then...
VB Code:
Select Case sht.cells(3,1)
Case vbNullstring
sht.cells(3,2) = "Cell is blank"
' and so on and so on.....
end Select
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|