Go To Statement

elgringo56

Well-known Member
Joined
Apr 15, 2002
Messages
869
I dont understand the go to statement, but I need to use it. I am running inside a next i loop. I am testing a cell for a blank condition using a Select Case Statement. If I find the cell is blank, I want to go to the "next i" end of the loop and bypass a lot of code. but I cant seem to figgure out how this works. Can anyone help me on this?
 
You haven't ended your select case.
eg.

<pre/>
Select Case Range("X1").Value
Case Is = ""
GoTo Blank
Case Else
Range("BE10:BE61").Select
Selection.Copy
Range("BB10:BB61").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("AP9").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End (xlToRight)).Select
Selection.ClearContents
Range("AP9").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.ClearContents
Range("AP10").Select
ActiveCell.CurrentRegion.Select
Selection.Copy
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("AP10:BB509").Select
Selection.ClearContents
End Select
Blank:
Next i
</pre>
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,214,914
Messages
6,122,211
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