Forum Discussion

PMHunt1955's avatar
PMHunt1955
Brass Contributor
Apr 03, 2019
Solved

Correct use of Worksheets statement in VBA

I have a function where I am seeking to look across from  a worksheet in one workbook to a worksheet in another workbook.   I have created a name reference across to the other sheet, the name is Su...
  • PeterBartholomew1's avatar
    Apr 04, 2019

    PMHunt1955 

    I wonder whether opening the target workbook and then working step by step might provide a starting point.

     

    Set wb = Workbooks("Genealogical_Service_Users_Tracing_Project_Families.xlsm")
    Set ws = wb.Worksheets("Names in Alpha Order")
    Test_Surname = ws.Cells(3, 4).Value

     

    Something radically different might be to ditch the usual sheet name and cell address approach and go for a Table using Power Query?

Resources