I have several Excel spreadsheets with macros that run on up to 70,000 items. I wrote the Macros to allow for up to 70,000 rows, but some of the spreadsheets only have 450 rows.
As a result, in the export to CSV, I end up with a series of commas up to the 70,000 line which messes up when I try to import the CSV as a feed into my Drupal site.
This is a newbie question, but how can I write these in macros to just run to the last line that has values in it and not how I did to account for the largest spreadsheet?
For example, I have written some as such:
Range("e3:e70000").NumberFormat = "mm-dd-yy"••••
or
For Each cell In Range("c2:c70000")
or
Range("J3:J70000").Replace What:=".jpg", Replacement:="_2.jpg"
I realize it is the 70000 that is getting me into trouble, but am unsure how to write it to read the Range from the first line J3 to the last row with data (J not fixed at 70,000)
Thanks!
As a result, in the export to CSV, I end up with a series of commas up to the 70,000 line which messes up when I try to import the CSV as a feed into my Drupal site.
This is a newbie question, but how can I write these in macros to just run to the last line that has values in it and not how I did to account for the largest spreadsheet?
For example, I have written some as such:
Range("e3:e70000").NumberFormat = "mm-dd-yy"••••
or
For Each cell In Range("c2:c70000")
or
Range("J3:J70000").Replace What:=".jpg", Replacement:="_2.jpg"
I realize it is the 70000 that is getting me into trouble, but am unsure how to write it to read the Range from the first line J3 to the last row with data (J not fixed at 70,000)
Thanks!