Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One solution solved one more to go€¦ Loop & Cell variables?
I'm staring a new question because "officially" the other one is solved... (TRUE/FALSE by merely Clicking cell) I was provided the following solution which works exactly as I need it. ------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$Q$12" Then If UCase(Range("R11")) = "TRUE" Then Range("R11") = "FALSE" Else Range("R11") = "TRUE" End If End If Cancel = True End Sub ------------------------- Problem is€¦ that that Rows 11-22 are replicated (sometimes 5 times maybe 20 times€¦ The first set of Rows include Cells Q12, R11, and maybe A13 if needed to see if there are any more rows of data to test for€¦ I was wondering if you code a loop in Excel/VBA to cover looping and referencing a cell buy a dynamic number. (Im a mainframe programmer trying to get used to this VBA stuff€¦) But something the looks like this: ------------------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) RowR=11 RowQ=12 RowA=13 ' \ / \ / Do While ISNUMBER(A&RowA) = "FALSE" If Target.Address = "$Q$&RowQ" Then If UCase(Range("R&RowA")) = "TRUE" Then Range("R&RowA") = "FALSE" Else Range("R&RowA") = "TRUE" End If End If RowR=11 RowQ=12 RowA=13 End If Cancel = True End Sub ----------------------- Anyone want to take a stab at this? Thanks in advance if you can€¦ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting Multiple Variables with a loop | Excel Discussion (Misc queries) | |||
solved problem | Excel Worksheet Functions | |||
Excel VBA - changing variables during a loop | Excel Programming | |||
Newbie. Please help me find a loop solution | Excel Programming | |||
Newbie. Please help me find a loop solution | Excel Programming |