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
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
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
 
Upvote 0

Forum statistics

Threads
1,214,913
Messages
6,122,207
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top