LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 115
Default One solution solved one more to go€¦ Loop & Cell variables?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Multiple Variables with a loop jlclyde Excel Discussion (Misc queries) 6 November 11th 09 09:40 PM
solved problem claude Excel Worksheet Functions 1 July 7th 06 08:14 PM
Excel VBA - changing variables during a loop ellis_x[_3_] Excel Programming 3 July 5th 04 08:44 AM
Newbie. Please help me find a loop solution Nigel Brown[_3_] Excel Programming 1 July 16th 03 02:48 PM
Newbie. Please help me find a loop solution Nigel Brown[_2_] Excel Programming 0 July 16th 03 10:25 AM


All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"