This forum has been moved to TeachExcel.com
Ask all future questions in the New Excel Forum.
ExcelKey
Sub Button1_Click()
Dim ws As Worksheet
Dim col As Long
Set ws = Sheets("Sheet1")
With ws
col = .Cells(7, 5).Value
col = col + 1
If col = 10 Then col = 2
.Cells(7, 5).Value = col '<~~~~~ the current column stored in E7
'to see which column is current
.Range("B10:I10").Interior.ColorIndex = 0
.Cells(10, col).Interior.ColorIndex = 6
End With
End Sub
Return to Macros and VBA Questions
Users browsing this forum: Baidu [Spider], Google [Bot] and 225 guests