myactiondesign
New Member
- Joined
- Mar 30, 2013
- Messages
- 31
Hi All,
I'm really stuck and would appreciate some help if any of you have five minutes to spare - my VBA knowledge is growing, but still limited.
I am looking to have a user InputBox to enter sales for 6 weeks, as shown below:
---
Sub InputUserData()
'This sub will create six messages boxes for user input
'The user input will be the first six weeks' sales of a new product
'The data will automatically be input into "Data"
Worksheets("Data").Activate
Dim intWeeknum As Integer
Dim rngWeeks As Range
intWeeknum = 1
For Each rngWeeks In Range("C8:C13")
rngWeeks.Value = InputBox("Please enter the sales for week " & intWeeknum)
intWeeknum = intWeeknum + 1
Next rngWeeks
End Sub
---
The issue: I'm looking for each InputBox to check that a) the value is between two certain values [say $1'000 and $2'000], and b) that the value is an integer.
If either of these conditions are not met, I need to repeat the same week's input.
I have literally no idea how to do this within an existing For statement.
Any ideas?
Any and all help will be greatly appreciated!
Thanks in advance!
!&...
I'm really stuck and would appreciate some help if any of you have five minutes to spare - my VBA knowledge is growing, but still limited.
I am looking to have a user InputBox to enter sales for 6 weeks, as shown below:
---
Sub InputUserData()
'This sub will create six messages boxes for user input
'The user input will be the first six weeks' sales of a new product
'The data will automatically be input into "Data"
Worksheets("Data").Activate
Dim intWeeknum As Integer
Dim rngWeeks As Range
intWeeknum = 1
For Each rngWeeks In Range("C8:C13")
rngWeeks.Value = InputBox("Please enter the sales for week " & intWeeknum)
intWeeknum = intWeeknum + 1
Next rngWeeks
End Sub
---
The issue: I'm looking for each InputBox to check that a) the value is between two certain values [say $1'000 and $2'000], and b) that the value is an integer.
If either of these conditions are not met, I need to repeat the same week's input.
I have literally no idea how to do this within an existing For statement.
Any ideas?
Any and all help will be greatly appreciated!
Thanks in advance!
!&...