I am quite new to VBA, I have attempted to write a code below, but I'm getting a type mismatch error (Highlighted below). What I am trying to achieve is the following:
I have a list of properties on column A (all hyperlinked to their own respective sheets) on the first summary sheet called "sheet"
- For each property, go to that properties sheet
- Copy the value 3 cell right to the cell with the string "Total for this Property"
- Switch back to "sheet" and paste the value into column D, next to the corresponding property name in column A.
I think the issue is the way I am referencing the value in the other sheet, but I can't seem to find anywhere how to reference a value that is located somewhere relative to a cell with a specific text.
Thank you in advanced!
Sub Summary()
Dim MasterBook As Workbook
Dim Sht As Worksheet
Dim Rng, Rng2 As Range
Set MasterBook = ThisWorkbook
Set Sht = MasterBook.Worksheets("Sheet")
Set Rng = Sht.Range("A6:A" & Sht.Cells(Sht.Rows.Count, "A").End(xlUp).Row)
Dim Cell As Range
For Each Cell In Rng
Cell.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Cell.Offset(0, 3).Value = Cell.Value("Total for this Property").Offset(0, 3).Value '<---- This line is giving the error
Next Cell
End Sub