VBA Help with formula
I am writing a module to read cells from one worksheet and place the value in another worksheet in the same workbook. I am using variables within my loop to read through the rows. I am getting a error in the formula. I am sure it has to do with where I have the quotes. Below is part of the code. Help will be much appreciated. As you will see in the code I have tried referencing by cells 2 different ways and both give me an error. I can make this work by assigning to a variable, but would rather directly address the cells.
//code
Sub GiftImportData()
Dim myrow As Long, myAssoc As Long, myAmtUSD As Double, myGiftOff As String, myGiftType As String
Dim mySegCode As String, myrowGift As Long
Sheets("giftimportdata").Select
myrow = 2
myrowGift = 11
Do Until IsEmpty(Range("a" & myrow)) Or Range("a" & myrow) = ""
Worksheets("giftimportdata").Range("A" & myrowGift).Formula = "='Raw Data'!" & "Range(""c"" & myrow & ).value"
Range("B" & myrowGift).Formula = "='Raw Data'!" & Cells(myrow, 13) & ".value"
|