Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In Cell *A1* i have a date. Cell B1 says "=A1"
I run a macro and added +7 to make cell B1 read "=A1+7". When I run the macro again nothing happens. I need to be able to run a simple macro and be able to increase th date by 1 week each time the macro is run. Can anyone help? Thanks Mat -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Matt
correct me if I'm wrong but A1 hasn't changed. So if you keep setting B1 to read "=A1+7" you're going to keep getting the same answer. I think you need to change the increment: first time through, add 7; second time through, add 14; and so on. Regards Trevor "mattwilsonuk " wrote in message ... In Cell *A1* i have a date. Cell B1 says "=A1" I run a macro and added +7 to make cell B1 read "=A1+7". When I run the macro again nothing happens. I need to be able to run a simple macro and be able to increase the date by 1 week each time the macro is run. Can anyone help? Thanks Matt --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "mattwilsonuk " ha scritto nel messaggio ... In Cell *A1* i have a date. Cell B1 says "=A1" I run a macro and added +7 to make cell B1 read "=A1+7". When I run the macro again nothing happens. I need to be able to run a simple macro and be able to increase the date by 1 week each time the macro is run. Can anyone help? ..... x = 7 Range("B1").FormulaR1C1 = "=RC[-1]+" & x ...... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can i make the macro run in increments?
Where does that formula x=7 range.... go? Thx Mat -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "mattwilsonuk " ha scritto nel messaggio ... How can i make the macro run in increments? Where does that formula x=7 range.... go? ..... x = Range("B1") Range("B1").FormulaR1C1 = "=RC[-1]+" & 7 ..... |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I really appreciate you helping me out and ive been tinkering with th
formala you gave me - been moving it around. I dont know what to do with it tho - I put it somewhere when i run th macro? Mat -- Message posted from http://www.ExcelForum.com |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Isnt that VBA script because ive not really gone that far into excel an
cant say i know a great del about it - my macro is being created when to to tools - macro - record new macro. Mat -- Message posted from http://www.ExcelForum.com |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Go into the VB IDE (Alt-F11)
Insert a new code module (InsertModule) Add this code Sub Add7() If Range("B1").Value = "" Then Range("B1").VAlue = Range("A1").Value Else Range("B1").Value= Range("B1").Value + 7 End If Range("B1").Numberformat = "dd mmm yyyy" End Sub Then every time you want to increase it, run the Sub acelled Add7. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "mattwilsonuk " wrote in message ... Isnt that VBA script because ive not really gone that far into excel and cant say i know a great del about it - my macro is being created when i to to tools - macro - record new macro. Matt --- Message posted from http://www.ExcelForum.com/ |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Matt,
Are both A1 and B1 formated for Dates? If so in cell B1= A1+7 it should increase 1 week. However if the dat in A1 stays the same then no matter how many time you run your macr the date will alway be the same. HTH Charle -- Message posted from http://www.ExcelForum.com |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The date in A1 remains the same throughout.
I was hoping the Macro would create something as crude as =a1+7+7+7+7+7+7+7+7+7+7+7" depending on the number of times I ran th macro. Is there another function I can use to acheive the desired result? Thx for your input Mat -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Increasing date in link | Excel Worksheet Functions | |||
Increasing Macro Efficieny | Excel Discussion (Misc queries) | |||
Increasing the date/time in cells on a worksheet with a button | Excel Worksheet Functions | |||
macro save a workbook whilst increasing file no | Excel Worksheet Functions | |||
Increasing M in M/D/Y | Excel Discussion (Misc queries) |