VBA macro

Dr Who

Senior Member
Joined
Jun 4, 2010
Messages
646
Reaction score
3
Hi ALL

I have created a basic VBA macro for excel which allows me to copy a selected tab into a new work book and then save it in a specific location.

However I would like to be able to do the following:
1) I need to be able to change one cell in the original workbook before copying, I will need to select a number between 1 - 12 ( can you build a pop up box that asks for this number)?

background is this number drivers the entire work book and I need a user to be able to set it based on his/her judgement.

Regards
 
Yes you can use:
InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])

For example:
Dim sUserNum As String
sUserNum = InputBox("Enter Value:", "User Value")

'Test if you have a valid number
If Not (Len(sUserNum ) > 0 And IsNumeric(sUserNum )) Then
MsgBox "Not a valid number.", vbCritical
Exit Sub
End If
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X