Pulling Info From Other Excel Sheets With Dynamic Cell Reference

Sobrien9900

New Member
Joined
May 11, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am creating a tool that will verify some barcodes that we print from a .csv file. The tool works by comparing a barcode scan to the actual .csv file. Using an xlookup, I can put a fixed reference to the sheet with the .csv data. However, the .csv files are saved in a network file. I need a way to create a dynamic reference to the sheets in the folder on the network drive. The dynamic reference source would be in a fixed cell on the comparison tool sheet.

Cell in main sheet = concat of PN/LN

in this case = 701350233785

='S:\Manufacturing\Filling - Packaging\Filling\[701350233785.xlsx]701350233785'!F6

So, if I scan a new PN/LN 701255087568 in the main sheet reference cell, the references change to

='S:\Manufacturing\Filling - Packaging\Filling\[701255087568.xlsx]701255087568'!F6

Is there a way to accomplish this? The workbooks with the .csv will be closed, not open.

Thank you
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hey there,
Try this

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim KeyCell As Range

' The variable KeyCell contains the cells that will
    ' update the forumla whem the cell is changed.
    Set KeyCell = Range("A1) 'set your Keycell here

If Not Application.Intersect(KeyCell, Range(Target.Address)) _
           Is Nothing Then


        ' Place your code here.
    Target.FormulaR1C1 = "='S:\Manufacturing\Filling - Packaging\Filling\[701255087568.xlsx]701255087568'!R[4]C[4]"

        MsgBox "Cell " & Target.Address & " has changed."
'delete the MsgBox line after testing

End If
End Sub
 
Upvote 0
Appreciate the help. Tried the code and its not working for me.

Essentially I'm creating a mirror sheet from another workbook based on the file name. When I change the reference cell in the main sheet, the mirror sheet updates and pulls the info from the new file referenced. There might be another way to do this? Ive added some screens grabs that might better help explain. Im pretty novice at this. Any help is much appreciated.
 

Attachments

  • Main Sheet Reference Cell.png
    Main Sheet Reference Cell.png
    10.8 KB · Views: 6
  • Mirror Sheet (sheet name .csv).png
    Mirror Sheet (sheet name .csv).png
    20.5 KB · Views: 6
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,209
Members
453,023
Latest member
alabaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top