Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
tod tod is offline
external usenet poster
 
Posts: 114
Default 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/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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/


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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/




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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/


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
How do i find last not empty cell in a range excelent Excel Worksheet Functions 9 December 31st 08 01:59 PM
Find empty cell then stop Dolphinv4 Excel Discussion (Misc queries) 1 May 28th 08 02:24 PM
find last none empty cell kevcar40 Excel Discussion (Misc queries) 3 March 1st 06 11:59 AM
Find 1st Empty Cell: How to? Chris Excel Programming 4 December 2nd 03 09:41 PM
Find Empty Cell Wally Steadman[_3_] Excel Programming 3 November 23rd 03 10:50 PM


All times are GMT +1. The time now is 05:34 AM.

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"