Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi There
I am looking to write a macro that opens a spreadsheet, looks at the number of rows that are occupied by data, then selects the next blank cell to paste a new line of data from another spreadsheet. Is this possible? Jamie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jamie!
You can determine the next empty row with: Dim nNewRow As Long nNewRow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1 I hope this helps. Herbert "Jamie" wrote: Hi There I am looking to write a macro that opens a spreadsheet, looks at the number of rows that are occupied by data, then selects the next blank cell to paste a new line of data from another spreadsheet. Is this possible? Jamie |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Oh my, I am getting old!
The correct formula is: nNewRow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row Sorry for that! Herbert "Herbert" wrote: Hi Jamie! You can determine the next empty row with: Dim nNewRow As Long nNewRow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1 I hope this helps. Herbert "Jamie" wrote: Hi There I am looking to write a macro that opens a spreadsheet, looks at the number of rows that are occupied by data, then selects the next blank cell to paste a new line of data from another spreadsheet. Is this possible? Jamie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count Number of Rows | Excel Worksheet Functions | |||
COUNT NUMBER OF ROWS | Excel Worksheet Functions | |||
Count how many Rows ago a particular number was hit | Excel Worksheet Functions | |||
Count number of rows, where non relevant rows are hidden | Excel Discussion (Misc queries) | |||
Count rows and insert number to count them. | Excel Discussion (Misc queries) |