Using a Worksheet name from a Cell
Using a Worksheet name from a Cell
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Using a Worksheet name from a Cell

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    George
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I need to open a succession of workbooks. I would like to store the workbook names in a column, use the data value in the Workbooks.Open Filename: command. How do I convert the value of a cell (i.e. A19) to use it in the open command??

  2. #2
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    You could use something like this:

    Sub openit()

    fname = WorksheetFunction.Substitute(Range("a19").Value, ".xls", "")
    Workbooks.Open Filename:= _
    "c:temp" & fname & ".xls"
    End Sub


    Just need to get the file path right...You could put this in the cell as well and get rid of "c:temp" &

    Double quotes in this post should really be single quotes. Hope this helps. Cheers,

    Nate

    [ This Message was edited by: NateO on 2002-03-12 10:30 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com