+ Reply to Thread
Results 1 to 2 of 2

Thread: extracting workbook name, worksheet name and column nr from hyperlink

  1. #1
    Registered User
    Join Date
    11-23-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    1

    extracting workbook name, worksheet name and column nr from hyperlink

    Dear all,

    I am preparing a macro which should copare two trial balances. It should also copy the first column - the account number and one more column with balances, wheras the column number depends on the source file. My question is: I would like that the user would click on specific column (or a cell) in any source file on the harddisk and the VBA would be able extract from this link the workbook name (incl. path), worksheet name and the column number of this cell, so that I would be able to set it as a variable and I would be able to work with it.
    I would be greatful for any help as I am quite new to VBA.

  2. #2
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566

    Re: extracting workbook name, worksheet name and column nr from hyperlink

    Hi,

    Why not just apply the value obtained with
    Application.GetOpenFileName
    to a string variable.

    You can then use that variable to open the file, then with a Message Box ask the user to select a cell, and then use another variable to capture the selection. e.g.
    stAddress = ActiveCell.Address

    Regards
    Richard Buttrey

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0