ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Please help find the next empty cell (https://www.excelbanter.com/excel-programming/298588-please-help-find-next-empty-cell.html)

pcarsquared

Please help find the next empty cell
 
Here is the scenerio any help would be great!!!!


1. So I have two pages in the worksheet one named "form" and the othe
named "data".
2. The form page has a submitt button at the bottom that runs a macr
that basically cuts and pastes all required data to "data page".

Easy enough...My Problem...

How do I find the next open row (on the "data" page) so when the secon
line of data is entered it does not overwrite the first? Is thi
something that can "easily" be done in excel?

Any thoughts of Excel wisdom would be great

--
Message posted from http://www.ExcelForum.com


tod

Please help find the next empty cell
 
This will tell you the first available row at the end of a
range.

NextRow = ActiveSheet.Range("A65536").End(xlup).Row

Or you could return the address.

NextRow = ActiveSheet.Range("A65536").End(xlup).Row

tod

-----Original Message-----
Here is the scenerio any help would be great!!!!


1. So I have two pages in the worksheet one named "form"

and the other
named "data".
2. The form page has a submitt button at the bottom that

runs a macro
that basically cuts and pastes all required data to "data

page".

Easy enough...My Problem...

How do I find the next open row (on the "data" page) so

when the second
line of data is entered it does not overwrite the first?

Is this
something that can "easily" be done in excel?

Any thoughts of Excel wisdom would be great!


---
Message posted from http://www.ExcelForum.com/

.


TJ Walls

Please help find the next empty cell
 
Private Function LastRow() As Integer
Dim i as Integer
Dim stp as Boolean

i = 1
stp = IsEmpty(Worksheets("data").Cells(i, 1))
While stp = False
i = i + 1
stp = IsEmpty(Worksheets("data").Cells(i, 1))
Wend

LastRow = i
End Function


Hope this helps.

-TJ


On Mon, 17 May 2004 15:25:54 -0500, wrote:

Here is the scenerio any help would be great!!!!


1. So I have two pages in the worksheet one named "form" and the other
named "data".
2. The form page has a submitt button at the bottom that runs a macro
that basically cuts and pastes all required data to "data page".

Easy enough...My Problem...

How do I find the next open row (on the "data" page) so when the second
line of data is entered it does not overwrite the first? Is this
something that can "easily" be done in excel?

Any thoughts of Excel wisdom would be great!


---
Message posted from http://www.ExcelForum.com/



Bob Phillips[_6_]

Please help find the next empty cell
 

cNextRow = Worksheets("Data").Cells(Rows.Count,"A").End(xlUp) .Row+1

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"pcarsquared " wrote in message
...
Here is the scenerio any help would be great!!!!


1. So I have two pages in the worksheet one named "form" and the other
named "data".
2. The form page has a submitt button at the bottom that runs a macro
that basically cuts and pastes all required data to "data page".

Easy enough...My Problem...

How do I find the next open row (on the "data" page) so when the second
line of data is entered it does not overwrite the first? Is this
something that can "easily" be done in excel?

Any thoughts of Excel wisdom would be great!


---
Message posted from http://www.ExcelForum.com/




TJ Walls

Please help find the next empty cell
 
On Mon, 17 May 2004 15:25:54 -0500, wrote:


OR
lastRow = Worksheets("data").UsedRange.Rows.Count + 1

So many objects, so many members, so little time. :)

-TJ

Here is the scenerio any help would be great!!!!


1. So I have two pages in the worksheet one named "form" and the other
named "data".
2. The form page has a submitt button at the bottom that runs a macro
that basically cuts and pastes all required data to "data page".

Easy enough...My Problem...

How do I find the next open row (on the "data" page) so when the second
line of data is entered it does not overwrite the first? Is this
something that can "easily" be done in excel?

Any thoughts of Excel wisdom would be great!


---
Message posted from http://www.ExcelForum.com/



Anders S[_2_]

Please help find the next empty cell
 
One way

'*****
Option Explicit

Sub saveForm()
Dim destCell As Range
Set destCell = Worksheets("Data").Cells(Rows.Count, "A") _
.End(xlUp).Offset(1, 0)

With destCell
'assuming Form is the active sheet
.Offset(0, 0).Value = Range("B1").Value
.Offset(0, 1).Value = Range("B2").Value
.Offset(0, 2).Value = Range("B3").Value
.Offset(0, 3).Value = Range("B4").Value
End With

End Sub
'*****

HTH
Anders Silven

"pcarsquared " skrev i meddelandet
...
Here is the scenerio any help would be great!!!!


1. So I have two pages in the worksheet one named "form" and the other
named "data".
2. The form page has a submitt button at the bottom that runs a macro
that basically cuts and pastes all required data to "data page".

Easy enough...My Problem...

How do I find the next open row (on the "data" page) so when the second
line of data is entered it does not overwrite the first? Is this
something that can "easily" be done in excel?

Any thoughts of Excel wisdom would be great!


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 10:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com