Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro 1

Status
Not open for further replies.

jmuscat

Instructor
May 22, 2002
54
AU
I am recording and writing a macro to format an imported data file into excel for users.
What I am having trouble is, I need code to loop down a rows containing data, find the first blank row and then delete the next ten rows.
Can someone help me with the code.

jmuscat
 
The code should look something like this:

Dim RowIndex, ColIndex

Selection.End(xlDown).Select
RowIndex = ActiveCell.Row + 2
ColIndex = ActiveCell.Column

Cells(RowIndex, ColIndex).Select
For i = 1 To 10
Rows(RowIndex).Select
Selection.Delete Shift:=xlUp
Next

Not very elegant, but it does the job.

TTFN
 
irstuff
many thanks for the quick response, definitely saved a lot of work for my users.
A star for your time and effort.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top