ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open sheet "LBUD*", how (https://www.excelbanter.com/excel-programming/345287-open-sheet-lbud%2A-how.html)

Ctech[_42_]

Open sheet "LBUD*", how
 

I want the macro to open all sheets that starts with "LBUD". Can I d
this by writing Sheets("LBUD*").Open

Or doesn#t * work

--
Ctec
-----------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...fo&userid=2774
View this thread: http://www.excelforum.com/showthread.php?threadid=48400


Tom Ogilvy

Open sheet "LBUD*", how
 
You open workbooks, not sheets.

Only one sheet can have the focus.

Perhaps a clearer description of what what you want

in the mean time to open workbook beginning with LBUD in a specific
directory

Sub ABCD()
Dim sPath as String
Dim sName as String
sPath = "C:\My Folder\"
sName = dir(sPath & "LBUD*.xls")
do while sName < ""
workbooks.Open sPath & sName
sName = dir()
Loop
End Sub

--
Regards,
Tom Ogilvy


"Ctech" wrote in
message ...

I want the macro to open all sheets that starts with "LBUD". Can I do
this by writing Sheets("LBUD*").Open

Or doesn#t * work?


--
Ctech
------------------------------------------------------------------------
Ctech's Profile:

http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=484000




Ctech[_43_]

Open sheet "LBUD*", how
 

What I want the macro to do is to copy the range("A10:B15") for al
sheets which starts with LBUD. And then paste into a blank workbook.


i.e.

Worksheet("LBUD (2)") will be activated / selected
Worksheet("LBUD") will be activated / selected.

Worksheet("BAND") will *not* be activated


Hope this clearifies my problem.

Thank

--
Ctec
-----------------------------------------------------------------------
Ctech's Profile: http://www.excelforum.com/member.php...fo&userid=2774
View this thread: http://www.excelforum.com/showthread.php?threadid=48400


NickHK

Open sheet "LBUD*", how
 
Ctech,

Dim WS As Worksheet

For Each WS In ThisWorkbook.Worksheets
If WS.Name Like "LBUD*" Then
'Do your copy code
'etc
End If
Next

NickHK

"Ctech" wrote in
message ...

What I want the macro to do is to copy the range("A10:B15") for all
sheets which starts with LBUD. And then paste into a blank workbook.


i.e.

Worksheet("LBUD (2)") will be activated / selected
Worksheet("LBUD") will be activated / selected.

Worksheet("BAND") will *not* be activated


Hope this clearifies my problem.

Thanks


--
Ctech
------------------------------------------------------------------------
Ctech's Profile:

http://www.excelforum.com/member.php...o&userid=27745
View this thread: http://www.excelforum.com/showthread...hreadid=484000





All times are GMT +1. The time now is 06:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com