#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.misc
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find an empty cell and put a dash in it? markexcel Excel Worksheet Functions 5 October 12th 05 03:47 PM
How can I convert empty strings to empty cells? Shane Excel Discussion (Misc queries) 2 July 19th 05 12:10 PM
In Bar Chart, can we display both figures and their respective %a. Airtel Excel Discussion (Misc queries) 3 March 9th 05 02:35 PM
Using the Find tool in EXCEL TK Excel Worksheet Functions 2 February 11th 05 07:51 PM
Excel has a "Find Next" command but no "Find Previous" command. Michael Fitzpatrick Excel Discussion (Misc queries) 2 January 10th 05 11:45 PM


All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"