Consulting

Results 1 to 2 of 2

Thread: Addition of cells as path

  1. #1
    VBAX Regular
    Joined
    Jan 2017
    Location
    Warsaw
    Posts
    70
    Location

    Addition of cells as path

    Hey guys!

    How is it possible to access tables or cells inside tables, if they are not specified directly as a path?
    So the path for the file forms itself from file> table> cell
    If these three elements are now separated into 3 cells, how is it possible to combine them and declare them as a reference or as a path?

    With the help of = A1 + A2 + A3 I can not go any further.
    (A1 = file, A2=tbl, A3=cell)


    With best regards.


  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Depends, IS this Path going to be used in an Excel Worksheet Formula Or as a Variable in a VBA Procedure?

    You have the right idea ( A1 + A2 + A3) but you have to add in all the " notations" required.

    For example. Square brackets, quotes, dots, exclamation points, slashes, file extensions, etc


    For VBA. A1 is File, A2 is Sheet name, and A3 is Cell Address
     FullPath = $Path & "\" & Sheets(1).Range(a1) & ".xlsm" &
     "!Sheets(" & Sheets(1).Range(a2) & ").Range("  & Sheets(1).Range(a3) & ")"
    C:/Book1.xlsm!Sheets("Sheet1").Range("A1") YMMV
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •