+ Reply to Thread
Results 1 to 3 of 3

use variable in Workbooks("book1").Worksheets("sheet1").Range("a1"

  1. #1
    Luc
    Guest

    use variable in Workbooks("book1").Worksheets("sheet1").Range("a1"

    Is there a way that you can put a variable instead of "book1" in the
    Workbooks("book1").Worksheets("sheet1").Range("a1") statement?

  2. #2
    Ron de Bruin
    Guest

    Re: use variable in Workbooks("book1").Worksheets("sheet1").Range("a1"

    Hi Luc

    Try this

    Dim wb As Workbook
    Set wb = Workbooks("Book1.xls")
    wb.Sheets("Sheet1").Range("a1").Select

    change Set wb = Workbooks("Book1.xls")



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Luc" <[email protected]> wrote in message news:[email protected]...
    > Is there a way that you can put a variable instead of "book1" in the
    > Workbooks("book1").Worksheets("sheet1").Range("a1") statement?




  3. #3
    Jim Thomlinson
    Guest

    RE: use variable in Workbooks("book1").Worksheets("sheet1").Range("a1"

    dim strBook as string
    strBook = "book1"
    Workbooks(strBook ).Worksheets("sheet1").Range("a1")

    --
    HTH...

    Jim Thomlinson


    "Luc" wrote:

    > Is there a way that you can put a variable instead of "book1" in the
    > Workbooks("book1").Worksheets("sheet1").Range("a1") statement?


+ 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.6.0 RC 1