LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,345
Default Overwriting data

"Sue" wrote in message
...
Hi All

After viewing and trying all the options went with the Sandy Mann solution
Works OK for me



Well I'm genuinely surprised at that!

Using:

For rownum = startrownum To endrownum
If Cells(rownum, 1) = "" Then
freerownum = rownum
Exit For
End If
Next rownum

I could understand but I don't know why I put the < "" in that line unless
I was more tired than I thought!

Anyway, the whole For/Next loop can be replaced with one line:

freerownum = Cells(startrownum, 1).End(xlDown).Row + 1

Although to ensure that you never fill in more than to Row 250 you may want
to make it:

freerownum = Cells(startrownum, 1).End(xlDown).Row + 1
If freerownum 250 Then
MsgBox "No room left!"
Exit Sub
End If


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Sue" wrote in message
...
Hi All

After viewing and trying all the options went with the Sandy Mann solution
Works OK for me
--
Many Thanks

Sue


"Sandy Mann" wrote:

Joel,

Re-reading my response to your post it seems a lot more terse and brusque
than I intended. I did not mean it to be a putdown of your suggestion,
my
apologies if it sounded like one.

--
Kind regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Sandy Mann" wrote in message
...
Joel" wrote in message
...
The easiest way of getting the last row is the following

LastRow = Cells.SpecialCells(xlCellTypeLastCell).Row

Except the OP said in another post:
"Thanks for the reply however as I have data below row 250 "

so she is not looking for the last used Row. Additionally XL
*remembers*
the last cell that you have entered data into even although you later
delete
it, so it may not be the last Row of visible data.

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk











 
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 copy none excel data & paste in 2007 without overwriting data Wakefootin Excel Discussion (Misc queries) 2 October 8th 09 12:15 AM
Paste data into another workbook but not overwriting original data Me Excel Programming 1 December 13th 07 05:51 PM
How to add data into a text file without overwriting existing data J@Y Excel Programming 2 June 28th 07 03:10 PM
Overwriting data Cody Excel Discussion (Misc queries) 5 November 27th 05 02:40 AM
updating of data without overwriting the previous data updated teyhuiyi Excel Programming 0 April 7th 04 03:40 AM


All times are GMT +1. The time now is 10:22 PM.

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

About Us

"It's about Microsoft Excel"