View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
LizS[_4_] LizS[_4_] is offline
external usenet poster
 
Posts: 1
Default Get Info From Another Sheet


Bob
I have sussed out my problem - When I do the For statement I'm on a
sheet that has nothing in G. When I change to Address and run it, it's
fine. I now have the following problem

sFormula = "&""""&Address!RC[5]&"" ""&Address!RC[6]&""
""&Address!RC[7]"
If SheetExists("Address") Then
Worksheets("Address").Activate
For i = 2 To Cells(Rows.Count, "G").End(xlUp).Row
Worksheets("Sheet14").Activate
If Worksheets("Address").Range("G" & i) 0 Then
Cells(i, "C").FormulaR1C1 = _
"=Address!RC[3]&""""&Address!RC[4]" & sFormula
Else
Cells(i, "C").FormulaR1C1 = _
"=Address!RC[3]" & sFormula
End If
Next i
Else
Range("C2").Value = "None"
End If

How do I store the sheet name in a variable? In my example the new
sheet is Sheet14 but that won't always be the case.

Thanks again for your time
Regards
Liz


--
LizS
------------------------------------------------------------------------
LizS's Profile: http://www.excelforum.com/member.php...o&userid=28991
View this thread: http://www.excelforum.com/showthread...hreadid=487198