Hey everyone,
I want to reference a loop in other functions because depending on the loop count it is up to depends on the row i want.
For CounterVar = 1 To glr
Set CurrentActiveRow = CounterVar
cfs = CheckForSong
cfsd = CheckForSongD
cas = CurrentActiveSong
car = CurrentActiveRow
dtb.Worksheets("Interface").Range("B" & cfs).Value = pst.Range("A" & car).Value
dtb.Worksheets("Database").Range("N" & cfsd).Value = pst.Range("C" & car).Value
dtb.Worksheets("Database").Range("J" & cfsd).Value = pst.Range("D" & car).Value
dtb.Worksheets("Database").Range("K" & cfsd).Value = pst.Range("E" & car).Value
dtb.Worksheets("Database").Range("L" & cfsd).Value = pst.Range("F" & car).Value
dtb.Worksheets("Database").Range("M" & cfsd).Value = pst.Range("G" & car).Value
dtb.Worksheets("Database").Range("Q" & cfsd).Value = pst.Range("H" & car).Value
dtb.Worksheets("Index").Range("B" & cfs).Value = Pdate
Next CounterVar
Function CurrentActiveSong()
Dim car As Long
car = CurrentActiceRow
CurrentActiveSong = Range("B" & car).Value
End Function
I can't give a worksheet for this one as it is entangled with a database and would break the moment i removed it.
pretty much if i go
It will tell me what loop it is up to, so i know that it is certainly increasing numbers
But i can't reference it
The moment i do
CurrentActiveRow = CounterVar
If i hover over CurrentActiveRow i get [Empty] and if i hover over CounterCar i get [1] or what ever loop it is up to
I did have a code before this using select, it worked at first but i found it unreliable and just my computer dropping in speed could trip it up, if you have a better way of doing this i am open to ideas, i don't want to use select, speed is key but most important reliablity
If you need more information i will do my best to provide
Thanks
Bensley
Bookmarks