Macros and commend bottons

wfred

New Member
Joined
Jan 31, 2005
Messages
18
I am tring to update a cell on excell without channging the date in that cell each time . I have a due date cell h4 and next due date. I want to use a command botton. I do'nt know how to start need help.
Thank You, wfred
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
Hi wfred, welcome to the board.
I'm not getting a clear idea of just what you're wanting to do. Can you describe it in more detail? - Cell addresses, how the date gets entered, updated, etc. Does the cell to be updated already contain the date you don't want updated?
 

wfred

New Member
Joined
Jan 31, 2005
Messages
18
wfred here again . Yes cell that has the date in it also the cell with the next due date has a date in it also. ThankYou, wfred
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
I'm still not getting it. Can you describe it again, this time in as much detail as possible?
 

wfred

New Member
Joined
Jan 31, 2005
Messages
18
hey wfred here this is what I have spreadsheet on excel .I am tring to update a due date say it is in cell (h4) and Ihave to change that due every 7 days but Ihave about 500 rows to change . How Iam doing them one at time.but Ihave that due 14 days,some,30days this is were I need help thanks for your help. wfred
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,454
OK, I have an idea of what you want, but without any idea of your sheet's layout, or how you determine which dates get updated or by how much, here's a fairly simple approach.
You can select whichever cell(s) you want to change, run this code and input how many days you'd like to add to the selected dates.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> ExtendDueDate()
<SPAN style="color:#00007F">Dim</SPAN> i <SPAN style="color:#00007F">As</SPAN> Range, x <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Integer</SPAN>
x = <SPAN style="color:#00007F">In</SPAN>putBox("How many days do you want to add to these dates?", "Due date extension")
<SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> i In Selection
    i.Value = i.Value + x
<SPAN style="color:#00007F">Next</SPAN> i
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

Hope it helps,
Dan
 

Watch MrExcel Video

Forum statistics

Threads
1,122,689
Messages
5,597,556
Members
414,155
Latest member
Grainne whiteside

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top