Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding input to macro
I posted this yesterday but didn't get an answer so here it is again: ok just to restate my next question. I am using this code for the current date: Sub placeDate() Dim rng as Range set rng = cells(rows.count,"A").End(xlup) if not isempty(rng) then ' check that it isn't already there if rng.value = date then exit sub ' it isn't the current date, so place today's ' date in the next cell set rng = rng.offset(1,0) end if rng.Value = Date End Sub Now I want to ask the user what value to input into column E of the same row as the current date. Can I add that easily in now? And how? -- cappuccine ------------------------------------------------------------------------ cappuccine's Profile: http://www.excelforum.com/member.php...o&userid=28242 View this thread: http://www.excelforum.com/showthread...hreadid=482267 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding input to macro
You can use the InputBox() function to get input from the user.
cappuccine wrote: I posted this yesterday but didn't get an answer so here it is again: ok just to restate my next question. I am using this code for the current date: Sub placeDate() Dim rng as Range set rng = cells(rows.count,"A").End(xlup) if not isempty(rng) then ' check that it isn't already there if rng.value = date then exit sub ' it isn't the current date, so place today's ' date in the next cell set rng = rng.offset(1,0) end if rng.Value = Date End Sub Now I want to ask the user what value to input into column E of the same row as the current date. Can I add that easily in now? And how? -- cappuccine ------------------------------------------------------------------------ cappuccine's Profile: http://www.excelforum.com/member.php...o&userid=28242 View this thread: http://www.excelforum.com/showthread...hreadid=482267 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding input to macro
ok how do I use that? And how do I input that value into column E in the same row that the previous macro found as an open space to put the date in? -- cappuccine ------------------------------------------------------------------------ cappuccine's Profile: http://www.excelforum.com/member.php...o&userid=28242 View this thread: http://www.excelforum.com/showthread...hreadid=482267 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding input to macro
rng.Value = Date
rng.offset(0,4).value = InputBox("Supply value please") End Sub -- HTH RP (remove nothere from the email address if mailing direct) "cappuccine" wrote in message ... I posted this yesterday but didn't get an answer so here it is again: ok just to restate my next question. I am using this code for the current date: Sub placeDate() Dim rng as Range set rng = cells(rows.count,"A").End(xlup) if not isempty(rng) then ' check that it isn't already there if rng.value = date then exit sub ' it isn't the current date, so place today's ' date in the next cell set rng = rng.offset(1,0) end if rng.Value = Date End Sub Now I want to ask the user what value to input into column E of the same row as the current date. Can I add that easily in now? And how? -- cappuccine ------------------------------------------------------------------------ cappuccine's Profile: http://www.excelforum.com/member.php...o&userid=28242 View this thread: http://www.excelforum.com/showthread...hreadid=482267 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding input to macro
awesome.. ok, another question. Now that I have the value from the input box, I want to repeat the code again to do the same thing on a different sheet. I changed rng to rng1 so I don't get a duplicate error. How do I use the value from the input box again without having to ask for it again? -- cappuccine ------------------------------------------------------------------------ cappuccine's Profile: http://www.excelforum.com/member.php...o&userid=28242 View this thread: http://www.excelforum.com/showthread...hreadid=482267 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding input to macro
rng.Value = Date
myVal = InputBox("Supply value please") rng.offset(0,4).value = myVal ' the other code rng1.offset(0,4).value = myVal End Sub -- HTH RP (remove nothere from the email address if mailing direct) "cappuccine" wrote in message ... awesome.. ok, another question. Now that I have the value from the input box, I want to repeat the code again to do the same thing on a different sheet. I changed rng to rng1 so I don't get a duplicate error. How do I use the value from the input box again without having to ask for it again? -- cappuccine ------------------------------------------------------------------------ cappuccine's Profile: http://www.excelforum.com/member.php...o&userid=28242 View this thread: http://www.excelforum.com/showthread...hreadid=482267 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto-adding text when a certain number is input | Excel Worksheet Functions | |||
Adding up within a cell during data input | Excel Discussion (Misc queries) | |||
run macro with input msg based on cell input | Excel Discussion (Misc queries) | |||
Having problems with adding input from combobox | Excel Programming | |||
adding sheets based on input | Excel Programming |