Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This snippet looks at column A and finds the last used cell (even if there
are some empty cells in the column) You should be able to make this code fit your needs. Dim lrw As Integer lrw= Cells(Rows.COUNT, "A").End(xlUp).Row This one counts the number of used cells in column A (good if there are no empty cells) lrw = WorksheetFunction.Counta(Columns(1)) in either case the fill range could be written as Set FRange = Sheets("Sheet1").Range("B1:B" & lrw) -- steveB Remove "AYN" from email to respond "bpreas - ExcelForums.com" wrote in message ... What I have is a macro that inserts a column and fills the cells in that column with certain text. I only need the cells filled down to the row where the existing data in the adjacent column ends. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to define how may rows or columns are present in excel 03 | Excel Discussion (Misc queries) | |||
Make pivot table with multiple "data" fields in columns not rows? | Excel Discussion (Misc queries) | |||
How do I make sure all empty columns are present in a .csv file? | Excel Worksheet Functions | |||
Continued Conversion of data from rows to columns in a macro. | Excel Programming | |||
How do I make a macro present (like an add-in) on opening Excel? | Excel Programming |