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
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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?
 
Upvote 0
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
 
Upvote 0
I'm still not getting it. Can you describe it again, this time in as much detail as possible?
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

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
Back
Top