Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Using wildcards in workbook calls

Why can't I get the following code to work? I want this macro to find an
open workbook called "ExportedData---" (where the dashes could be be
anything) and perform the following actions. That's why I'm using the *
wildcard. For example, one instance of the workbook might be named
"ExportedData[2]" the next instance might be called "ExportedData[1]". As
you can see from my comments I've tried messing around with a few different
methods but just can't make it work. In this current setup I'm getting a
"Compile Error: Argument not Optional" and it highlights the word Workbooks
in the With statement.

Sub CatalystToTally()

'Dim wb As Range
'Dim ws As Range
'Set wb = Workbooks
'Set ws = Worksheets

With Workbooks Like "ExportedData*"
'.Rows(1).Delete Shift:=xlUp
.Rows("1:1").Delete Shift:=xlUp
.Columns(D).ColumnWidth = 13
.Columns(D).NumberFormat = "0"
.Cells.Select
.Selection.Copy
.ThisWorkbook.Worksheets("Catalyst Dump").Paste
End With
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add-In Calls Sub in Active Workbook Paige Excel Programming 2 December 15th 08 06:25 PM
Wildcards in workbook name DCHK Excel Programming 1 July 10th 06 01:15 PM
Problem in updating all worksheets of a workbook using a macro that calls another macro [email protected] Excel Programming 3 March 20th 06 05:21 AM
Wildcards in other workbook cell refrence? Pootler Excel Worksheet Functions 1 June 2nd 05 05:55 PM
Any automation calls gets hung when the Excel workbook has an active cell. S.Tremblay Excel Programming 1 November 6th 03 05:43 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"