I have a macro that generates several things but sometimes my Number I need to use in a particular formula needs to be changed. How can I use a pop up that when the macro runs and gets to that formula it asks what correcting factor does it want to use inside the formula and then once the user inputs that value and hits enter the macro continues on"
sample Code1:
[code]
Sub CORRAzm()
Range("u3:u" & Selection.SpecialCells(xlCellTypeLastCell).Row).FormulaR1C1 = "=RC[-1]+8.1"
Range("u1").FormulaR1C1 = "Corr. Azm"
Columns("u:u").NumberFormat = "0.00"
Columns("u:u").Select
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
[code]
The (8.1) sometimes will need to be changed to whatever is the correcting factor.
Sample code2:
[code]
Sub Start()
Dim lLR As Long
lLR = Range("C" & Rows.Count).End(xlUp).Row
Rows("2:2").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("F2").Select
Range("F3").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-0.291666666666667"
Range("F3").Select
Selection.AutoFill Destination:=Range("F3:F" & lLR)
Range("F3:F" & lLR).Select
Columns("f:f").Select
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
[code]
Again the (0.291666666666667) would have to be changed.
Once I know the process I can duplicate other instances.
Bookmarks