LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Writing macros to sequentially change the address of a cell in Exc

I always name the cell of the first title. So if my title is A4, I name A4.
I expect the first row of data to start at A5. This way, if anyone inserts
or delete a title row, my code continues to work. Then:

Sub NewData()
Dim Rng As Range
Dim NextCell As Range
Set Rng = Range("First Title")
If IsEmpty(Rng.Offset(1, 0)) Then
Set NextCell = Rng.Offset(1, 0)
Else
NextCell = Rng.End(xlDown).Offset(1, 0)
End If
End Sub

Works well. This code also assumes that the first column of data always has
a value, otherwise the end method doesn't work. Note that End(xlDown) is the
same as Ctrl+Down.

--

Rod Gill

"Ken" wrote in message
...
I enter data into a spreadsheet on a daily basis and keep a sequential
record
of this data.

Rather than copy and paste to build up this historical data base I need a
macro that changes the cell address as new data is entered. This new
address
is the next line down in sequence for storing this historical information.

In other words if the last address was C55 after running the macro the
next
address would be C56 thence C57 if it is run again. So every time the
macro
is run it sequentially directs the data being stored into the next line.

I have used the Find function to get the first line for data storage but
rather than just searching for a key word it remembers the original cell
address and will not allow sequential recording to occur. What I need is
to
be able to change the cell address within the macro so future data can be
stored in subsequent cells.

Any assistance would be appreciated
--
Ken living downunder



 
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
Sequentially run macros CurtH Excel Programming 8 January 12th 06 04:23 PM
Concatenate cells without specifying/writing cell address individually Hari Excel Discussion (Misc queries) 4 January 3rd 05 06:05 PM
Writing a DLL using Visual Studio 6 to return cell address! agarwaldvk Excel Programming 3 July 5th 04 10:40 AM
Run Macros Sequentially William[_2_] Excel Programming 1 June 8th 04 03:21 PM
How not to fixed cell address in Macros Teak[_2_] Excel Programming 2 April 15th 04 05:08 AM


All times are GMT +1. The time now is 06:39 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"