using variables to select rows

  • Thread starter Thread starter vecha
  • Start date Start date
V

vecha

I see that this subject has been raised several times but the response
so far do not seem to help me. (I might be a bit slow on the uptake)

My problem is that in order to export a spread sheet to anothe
application successfully, I need to delete all of the blank rows fro
the end of the sheet. I have 200+ sheets with varying lengths so I nee
to automate.

I have a macro the works well providing I enter a constant in place o
the variable "DeleteRowsFromRowNumber" as shown below.

DeleteRowsFromRowNumber is declared as an integer

Rows("DeleteRowsFromRowNumber:65500").Select
Selection.Delete Shift:=xlUp.

Is there a special data type that must be used here.

Any assistance greatly appreciated
 
Simple syntax error... you have enclosed your variant in
the quotes, so it is read as a string rather than return
the variant's value. Change your select statement to:

Rows(DeleteRowsFromRowNumber & ":65500").Select

This should do the job.

Nikos Y.(nyannaco at in dot gr)
 
Back
Top