still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 826
- Office Version
- 365
- Platform
- Windows
hi
This works:
This doesn't. It only runs once.
I can't see what I'm doing wrong
The top one changes the fill of the row the user puts in the input box and does it x number of times
I'm trying to have a macro change the row back to "no fill" base on the user's input. start and x times.
Being a "still learning", I thought I could easily just change some of the working macro to suit the new conditions.
I had to add >>ActiveCell.Select << in the second to get the cursor back to the starting point (Range("B" & n).Select)
the first one didn't need it.
Also. If I want to combine the two can I just change the N and X of the second one?????
mike
This works:
Code:
Sub startbox()
Dim i As Long
n = InputBox(" Where Should the Fill Color Start?")
x = InputBox(" How many times to run?")
Range("B" & n).Select
For i = 1 To x
With Range("A1:I1").Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 16645315
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Next i
End Sub
Code:
Sub unfillnew()
Dim i As Long
n = InputBox(" Where does the Un fill Start?")
x = InputBox(" How many times to run?")
Range("B" & n).Select
For i = 1 To x
ActiveCell.Range("A1:I1").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Next i
ActiveCell.Select
End Sub
The top one changes the fill of the row the user puts in the input box and does it x number of times
I'm trying to have a macro change the row back to "no fill" base on the user's input. start and x times.
Being a "still learning", I thought I could easily just change some of the working macro to suit the new conditions.
I had to add >>ActiveCell.Select << in the second to get the cursor back to the starting point (Range("B" & n).Select)
the first one didn't need it.
Also. If I want to combine the two can I just change the N and X of the second one?????
mike