VBA Code to have User input data for cell

  • Thread starter Thread starter Bean Counter
  • Start date Start date
B

Bean Counter

Afternoon Gurus!!!

I have written the following code

Rows("1:5").Select
Selection.Insert Shift:=xlDown
Range("A1").Select
ActiveCell.FormulaR1C1 = "Company Name"
With Selection.Font
.Size = 16
End With
Range("A3").Select
ActiveCell.FormulaR1C1 = "TRIAL BALANCE FOR PERIOD ENDING:"
Range("F3").Select
ActiveCell.FormulaR1C1 = "4/30/2010"
Rows("1:3").Select
Selection.Font.Bold = True
Range("F3").Select
With Selection.Font
.Size = 14
.ColorIndex = 5
End With
End Sub

In the middle of the code, where it says "ActiveCell.FormulaR1C1 =
"4/30/2010"", I want to change that to where there is an input box that
appears, and the user has to put in a value. What would the code look
like?????
 
hi
i edited the code some. no need to do all that selecting.

Rows("1:5").Insert Shift:=xlDown
Range("A1").Value = "Company Name"
With [A1].Font
.Size = 16
End With
Range("A3").Value = "TRIAL BALANCE FOR PERIOD ENDING:"
'********************************
Range("F3").Value = InputBox("Enter a date")
'********************************
'edit the InputBox message if needed.
Rows("1:3").Font.Bold = True
With [F3].Font
.Size = 14
.ColorIndex = 5
End With

regards
FSt1
 
Back
Top