Adding 1 hour to input box

S

srroduin

I need to add 1 hour to what the user types in as ("Enter start time 24-hour
clock"). I already have it showing up in bold. There are 3 other buttons in
my worksheet that all use the same column for time so I can't just format the
cells for the entire column. Any suggestions??

Private Sub Hourly_Click()
Dim rng As Range

Set rng = ActiveSheet.Cells(Rows.count, "A").End(xlUp).Offset(1, 0)
rng.Value = InputBox("Enter start date mm/dd/yyyy")
rng.Offset(0, 1).Value = InputBox("Enter start time 24-hour clock")
rng.Offset(0, 1).Font.Bold = True
rng.Offset(0, 2).Value = InputBox("Enter stop date mm/dd/yyyy")
rng.Offset(0, 3).Value = InputBox("Enter stop time 24-hour clock")
rng.Offset(0, 4).Value = InputBox("Enter TSN to increase")
rng.Offset(0, 5).Value = InputBox("Enter TSN to decrease")
rng.Offset(0, 6).Value = InputBox("Enter MW Amount")
Set rng = Nothing


End Sub
 
S

Stefan B Rusynko

Wrong newsgroup
This is a FrontPage Newsgroup
- you need to post to an Excel Newsgroup
(See VBA help on DateAdd)
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I need to add 1 hour to what the user types in as ("Enter start time 24-hour
| clock"). I already have it showing up in bold. There are 3 other buttons in
| my worksheet that all use the same column for time so I can't just format the
| cells for the entire column. Any suggestions??
|
| Private Sub Hourly_Click()
| Dim rng As Range
|
| Set rng = ActiveSheet.Cells(Rows.count, "A").End(xlUp).Offset(1, 0)
| rng.Value = InputBox("Enter start date mm/dd/yyyy")
| rng.Offset(0, 1).Value = InputBox("Enter start time 24-hour clock")
| rng.Offset(0, 1).Font.Bold = True
| rng.Offset(0, 2).Value = InputBox("Enter stop date mm/dd/yyyy")
| rng.Offset(0, 3).Value = InputBox("Enter stop time 24-hour clock")
| rng.Offset(0, 4).Value = InputBox("Enter TSN to increase")
| rng.Offset(0, 5).Value = InputBox("Enter TSN to decrease")
| rng.Offset(0, 6).Value = InputBox("Enter MW Amount")
| Set rng = Nothing
|
|
| End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top