Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following VBA code in which I am identifying the number of rows in
a workbook named "FileOpenNameLast." This name includes the full path of the workbook and, therefore, my code deosn't work. Isn't there a simple way to refer to the workbook name in my code? NumRowsF832 = Workbooks(FileOpenNameLast).Name.Sheets(1).Range(" A65536").End(xlUp).Row -- Ken Hudson |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When accessing an open file, you don't use the path.
Best way is to get the name when you open it. -- HTH Bob Phillips "Ken Hudson" wrote in message ... I have the following VBA code in which I am identifying the number of rows in a workbook named "FileOpenNameLast." This name includes the full path of the workbook and, therefore, my code deosn't work. Isn't there a simple way to refer to the workbook name in my code? NumRowsF832 = Workbooks(FileOpenNameLast).Name.Sheets(1).Range(" A65536").End(xlUp).Row -- Ken Hudson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If xl2000 or later
Dim v as Variant Dim sName as String Dim FileOpenNameLast as String ' code that populates FileOpenNameLast with a fully qualified path name v = Split(FileOpenNameLast,"\") sName = v(ubound(v)) NumRowsF832 = Workbooks(sName).Sheets(1).Range("A65536").End(xlU p).Row -- Regards, Tom Ogilvy "Ken Hudson" wrote in message ... I have the following VBA code in which I am identifying the number of rows in a workbook named "FileOpenNameLast." This name includes the full path of the workbook and, therefore, my code deosn't work. Isn't there a simple way to refer to the workbook name in my code? NumRowsF832 = Workbooks(FileOpenNameLast).Name.Sheets(1).Range(" A65536").End(xlUp).Row -- Ken Hudson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing other workbook. | Excel Worksheet Functions | |||
Referencing a different Workbook | Excel Worksheet Functions | |||
Referencing another Workbook | Excel Discussion (Misc queries) | |||
referencing another workbook | Excel Programming | |||
Referencing one workbook in other??? | Excel Programming |