noslenwerd
Board Regular
- Joined
- Nov 12, 2019
- Messages
- 85
- Office Version
- 365
I am trying to pull a value from a named range on worksheet "Drew", and write to a named range in worksheet "Bill"
I am getting a Runtime 1004 error on the bolded line below. What am I missing?
When I run this without referencing a different sheet it works fine.
See the comment in the code below
I am getting a Runtime 1004 error on the bolded line below. What am I missing?
When I run this without referencing a different sheet it works fine.
See the comment in the code below
VBA Code:
Sub populatetopics()
Dim RevRow, FinalCol As Long
Dim FileLoc As String
Dim ReviewName, RevCount2 As String
Dim cel As Range
Dim shtA As Worksheet
Dim shtB As Worksheet
Set shtA = Sheets("Drew")
Set shtB = Sheets("Bill")
RevRow = 1
FinalCol = 1
For Each cel In shtA.Range("DrewR")
If shtA.Cells(RevRow, 1).Value <> "" Then
ReviewName = shtA.Cells(RevRow, 1).Value
FileLoc = shtA.Range("A19").Value & ReviewName & ".html"
shtB.Range("BillFinal").Cells(0, FinalCol).Value = FileLoc 'This is where the 1004 error happens*************************
RevRow = RevRow + 1
FinalCol = FinalCol + 1
End If
Next cel
End Sub