Creating a Relative Macro

  • Thread starter Thread starter Mar
  • Start date Start date
M

Mar

I am missing probably a simple step in creating a macro
for a worksheet. The problem seem to be when I "carry
out the actions I want to record."

Objective: Create a macro to add seven days to the date
in the previously dated cell. (There are rows between the
dates)

Problems Recording:
How can I tell if the "relative" button is active?
Once I click on the "relative" button (I think), then
click on the blank cell, type in the forumul -- i.e., =sum
(a4+7) -- (while I am doing this, the recording toolbar
fades out) -- and then hit enter, then click on the stop
recording button.
I also included a shortcut key (Ctl + d).
 
-----Original Message-----
I am missing probably a simple step in creating a macro
for a worksheet. The problem seem to be when I "carry
out the actions I want to record."

Objective: Create a macro to add seven days to the date
in the previously dated cell. (There are rows between the
dates)

Problems Recording:
How can I tell if the "relative" button is active?
Once I click on the "relative" button (I think), then
click on the blank cell, type in the forumul -- i.e., =sum
(a4+7) -- (while I am doing this, the recording toolbar
fades out) -- and then hit enter, then click on the stop
recording button.
I also included a shortcut key (Ctl + d).

Then, what happens when I click the cell that I want to
add a macro to is that only the number "7" appears.

CAN ANYBODY HELP ME?

(Please excuse my misspells and line formatting. I
accidently hit Send too early.)
 
Mar, do you need a macro? can you just type in a cell =A4+7, if you need a
macro how do you know what cell to add 7 to and where do you want the
answer. This will give you the date in the active cell + 7
Sub test()
MsgBox ActiveCell + 7
End Sub

Does this help?


--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
Don't know anything about a 'relative' button, but I had a similar
problem recently where I could record a macro to find the last
non-blank cell in my range, but couldn't get it to select the next cell
down which was blank.

Someone on here kindly gave me the following line of code which sorted
my problem out perfectly! Hope it does for you too.....

ActiveCell.Offset(1, 0).Range("A1").Select
 
Back
Top