![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 86
|
I have a spreadsheet which imports a CSV file. I have setup a macro to import and format the CSV correctly. However what I need is to be able to find the first blank cell at the bottom of each column of data and total the entire column. If I use the macro recorder it gives me a fixed range i.e A2:A256. Unfortunately the CSV file differs in size every month and the VBA code should cope with this.
TIA Rex. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
|
Just a little FYI that people don't seem to think of: put your totals at the top.
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
This should get you started.
Sub MySum() Range("A65536").End(xlUp).Offset(1).FormulaR1C1 = "SUM(R2C:R[-1]C)" End Sub |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Quote:
Sub MySum() Range("A65536").End(xlUp).Offset(1).FormulaR1C1 = "=SUM(R2C:R[-1]C)" End Sub PLEASE, NO PRIVATE MESSAGES, ANSWER TO THE FORUM. _________________ Regards, Juan Pablo G. MrExcel.com Consulting [ This Message was edited by: Juan Pablo G. on 2002-02-20 08:57 ] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|