![]() |
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? |
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" wrote in message ... Is there a way that you can put a variable instead of "book1" in the Workbooks("book1").Worksheets("sheet1").Range("a1" ) statement? |
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? |
All times are GMT +1. The time now is 08:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com