Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Wilcard for Workbooks???

I have a weekly report which I generate a csv for the data and populate in a
standard xls workbook. The xls workbook only changes it's name based on date
it's generated. The csv normally only has deployments.csv & Weekly
Deployments test.xls usually ends with a date format not "test"(I changed the
code below during testing).

Aside from generating more code to make the xls workbook fromscratch or
adding a worksheet and moving the csv data over, is there a wildcard I can
use for the active workbook??

Here is some of the code:
--------------------------------------------------------------------------
Windows("deployment-1.csv").Activate
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(103,R[1]C[-2]:R[1985]C[-2])"
ActiveCell.Offset(0, -4).Columns("A:C").EntireColumn.Select
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:="=*10.53**", Operator:=xlOr, _
Criteria2:="=*pswe**"
ActiveCell.Offset(0, 4).Range("A1").Select
Selection.Copy
Windows("Weekly Deployments test.xls").Activate
ActiveCell.Offset(4, 7).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("deployment-1.csv").Activate
Selection.AutoFilter Field:=3, Criteria1:="=*10.63**", Operator:=xlOr
Application.CutCopyMode = False
Selection.Copy
Windows("Weekly Deployments test.xls").Activate
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
-----------------------------------------------------------------------------


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Wilcard for Workbooks???

If it's the active workbook when you start, you can save your place:

Dim ActWkbk as workbook
set actwkbk = activeworkbook
'do lots of stuff
actwkbk.activate 'instead of Windows("Weekly Deployments test.xls").Activate




Awrex wrote:

I have a weekly report which I generate a csv for the data and populate in a
standard xls workbook. The xls workbook only changes it's name based on date
it's generated. The csv normally only has deployments.csv & Weekly
Deployments test.xls usually ends with a date format not "test"(I changed the
code below during testing).

Aside from generating more code to make the xls workbook fromscratch or
adding a worksheet and moving the csv data over, is there a wildcard I can
use for the active workbook??

Here is some of the code:
--------------------------------------------------------------------------
Windows("deployment-1.csv").Activate
ActiveCell.Offset(0, 4).Range("A1").Select
ActiveCell.FormulaR1C1 = "=SUBTOTAL(103,R[1]C[-2]:R[1985]C[-2])"
ActiveCell.Offset(0, -4).Columns("A:C").EntireColumn.Select
Selection.AutoFilter
Selection.AutoFilter Field:=3, Criteria1:="=*10.53**", Operator:=xlOr, _
Criteria2:="=*pswe**"
ActiveCell.Offset(0, 4).Range("A1").Select
Selection.Copy
Windows("Weekly Deployments test.xls").Activate
ActiveCell.Offset(4, 7).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("deployment-1.csv").Activate
Selection.AutoFilter Field:=3, Criteria1:="=*10.63**", Operator:=xlOr
Application.CutCopyMode = False
Selection.Copy
Windows("Weekly Deployments test.xls").Activate
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
-----------------------------------------------------------------------------


--

Dave Peterson
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
Excel2007; workbooks.count is not counting all open workbooks greg.campeau Excel Programming 2 August 2nd 08 08:37 PM
Updating Workbooks from multiple links Workbooks TimJames Excel Worksheet Functions 1 December 15th 07 03:34 PM
Copy/ move selected data from workbooks to seperate worksheets or workbooks Positive Excel Worksheet Functions 1 August 30th 07 04:54 PM
Display 2 formulas from source workbooks to destination workbooks Excel_seek_help Excel Discussion (Misc queries) 4 April 27th 06 08:13 PM


All times are GMT +1. The time now is 04:59 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"