Conditon If / ElseIf

stan1020

New Member
Joined
Aug 22, 2006
Messages
8
Hello,

I am trying to use a condition to jump to a lign in my program
The condition is based on the fact that one cell is empty or not,

I have tried the following code, but it is not working,
does anybody have a magic idea?

Thanks!

[first_file].Offset(1, 0).Select
If [first_file].Offset(1, 0) Is Empty Then
GoTo onefile
ElseIf [first_file].Offset(1, 0) Is Not Empty Then
GoTo severalfiles
End If
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Macropheliac

Board Regular
Joined
Aug 26, 2005
Messages
165
Try it this way:
Code:
[first_file].Offset(1, 0).Select
If [first_file].Offset(1, 0).Value = "" Then
GoTo onefile
ElseIf [first_file].Offset(1, 0) <> "" Then
GoTo severalfiles
End If
 

Watch MrExcel Video

Forum statistics

Threads
1,113,850
Messages
5,544,650
Members
410,627
Latest member
georgealice
Top