Simple Macro Help **con't**

ultratch47

Board Regular
Joined
Aug 6, 2002
Messages
126
ok
this macro will require the need seperate two sets of data
IE. C2:C900 is one set
BLANK in between
C902:C1500 is another set
i need to just simply delete the second set with a macro line (i will create another macro for the other set later)

so macro will need to identify the FIRST blank in this row (since that blank seperating the sets is the only blank in this column) and delete the entire row below that one cell...

thanks
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
r = 1
Do Until r >= Range("C65535").End(xlUp).row or cells(r, 3) = ""
r = r + 1
loop

if r < Range("A65535").End(xlUp).row then blankrow = r
 
Upvote 0
Code:
Sub DeleteSecondSet()
Columns(3).Select
b = Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Row
a = Range("C65536").End(xlUp).Row
Range(Cells(b + 1, 3), Cells(a, 3)).Delete
End Sub
 
Upvote 0
North

It highlights the entire B= code (and two lines below)

"identifier under cursor is not reckognized"
 
Upvote 0
Code:
Sub DeleteSecondSet()
Columns(3).Select
b = Selection.Find(What:="", After:=[c1], LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Row
a = Range("C65536").End(xlUp).Row
Range(Cells(b + 1, 3), Cells(a, 3)).Delete
End Sub

it worked fine for me. here it is again, except i changed the Find after to cell c1 instead of activecell. you could give that a try.
 
Upvote 0

Forum statistics

Threads
1,203,460
Messages
6,055,556
Members
444,797
Latest member
18ecooley

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