Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find first empty row
Hi all,
I don't really know about coding but I'm trying to get a data-entry form to look for the first empty row based on Debra Dalgleish's coding on Contextures. So far I have; 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ ..End(x1Up).Offset(1, 0).Row but when I try to run the userform I get "Run-time error 1004". I don't know what this means but when I click on Debug the code above is what is highlighted. Any help would be much appreciated. Dave |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find first empty row
the 1 s/b l
iRow = ws.Cells(Rows.Count, 1) _ ..End(xlUp).Offset(1, 0).Row Also, Rows.Count is not qualified so it will refer to the active sheet, which is fine as all worksheets have the same number of rows. If you have chart sheets and one of those is the active sheet, you'll get an error. Fully qualified, it would be ws.Rows.Count " wrote: Hi all, I don't really know about coding but I'm trying to get a data-entry form to look for the first empty row based on Debra Dalgleish's coding on Contextures. So far I have; 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ ..End(x1Up).Offset(1, 0).Row but when I try to run the userform I get "Run-time error 1004". I don't know what this means but when I click on Debug the code above is what is highlighted. Any help would be much appreciated. Dave |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find first empty row
Thanks JMB,
Works fine now. I feel such a fool at committing such a simple error <blush Sometimes you can get too close to a problem is my only excuse. Dave JMB wrote: the 1 s/b l iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row Also, Rows.Count is not qualified so it will refer to the active sheet, which is fine as all worksheets have the same number of rows. If you have chart sheets and one of those is the active sheet, you'll get an error. Fully qualified, it would be ws.Rows.Count " wrote: Hi all, I don't really know about coding but I'm trying to get a data-entry form to look for the first empty row based on Debra Dalgleish's coding on Contextures. So far I have; 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ ..End(x1Up).Offset(1, 0).Row but when I try to run the userform I get "Run-time error 1004". I don't know what this means but when I click on Debug the code above is what is highlighted. Any help would be much appreciated. Dave |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Find first empty row
I understand all too well.
" wrote: Thanks JMB, Works fine now. I feel such a fool at committing such a simple error <blush Sometimes you can get too close to a problem is my only excuse. Dave JMB wrote: the 1 s/b l iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row Also, Rows.Count is not qualified so it will refer to the active sheet, which is fine as all worksheets have the same number of rows. If you have chart sheets and one of those is the active sheet, you'll get an error. Fully qualified, it would be ws.Rows.Count " wrote: Hi all, I don't really know about coding but I'm trying to get a data-entry form to look for the first empty row based on Debra Dalgleish's coding on Contextures. So far I have; 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ ..End(x1Up).Offset(1, 0).Row but when I try to run the userform I get "Run-time error 1004". I don't know what this means but when I click on Debug the code above is what is highlighted. Any help would be much appreciated. Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find an empty cell and put a dash in it? | Excel Worksheet Functions | |||
How can I convert empty strings to empty cells? | Excel Discussion (Misc queries) | |||
In Bar Chart, can we display both figures and their respective %a. | Excel Discussion (Misc queries) | |||
Using the Find tool in EXCEL | Excel Worksheet Functions | |||
Excel has a "Find Next" command but no "Find Previous" command. | Excel Discussion (Misc queries) |