PC Review


Reply
Thread Tools Rate Thread

automatic replacing of vbe code for multiple workbooks

 
 
pls123
Guest
Posts: n/a
 
      17th Nov 2009
hi all a got a workbook called.. Replacer, it contains this macro:

Sub rep()
On Error Resume Next
Dim Wb As Workbook

For Each Wb In Workbooks
If Left(Wb.Name, 6) = "MI.F@S" Then
Wb.Sheets("sheet1").Range("P2").Value = "-1"
End If

Next Wb
End Sub

now..
for each workbook in open workbooks whose name begins with "abc", i need to
replace or cancel a line or a piece of vbe ..

maybe this one:
If (Weekday(Now(), vbMonday)) Then
aWS.Range("V104").Value = aWS.Range("V104").Value * 2
End If

can anybody help me pls . tx !!


 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      17th Nov 2009
See Chip Pearson's website

http://www.cpearson.com/Excel/vbe.aspx

"pls123" wrote:

> hi all a got a workbook called.. Replacer, it contains this macro:
>
> Sub rep()
> On Error Resume Next
> Dim Wb As Workbook
>
> For Each Wb In Workbooks
> If Left(Wb.Name, 6) = "MI.F@S" Then
> Wb.Sheets("sheet1").Range("P2").Value = "-1"
> End If
>
> Next Wb
> End Sub
>
> now..
> for each workbook in open workbooks whose name begins with "abc", i need to
> replace or cancel a line or a piece of vbe ..
>
> maybe this one:
> If (Weekday(Now(), vbMonday)) Then
> aWS.Range("V104").Value = aWS.Range("V104").Value * 2
> End If
>
> can anybody help me pls . tx !!
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
automatic replacing of a VBE sub in all open workbooks pls123 Microsoft Excel Programming 2 13th May 2010 03:44 PM
How do I share VBA code in multiple workbooks? =?Utf-8?B?eHJiYmFrZXI=?= Microsoft Excel Programming 4 1st Mar 2007 06:00 PM
Replacing (identical) values in multiple workbooks simultaneously? BR4M Microsoft Excel Programming 8 25th Nov 2004 04:35 PM
Code for Multiple Workbooks Edgar Microsoft Excel Programming 1 24th Mar 2004 01:50 PM
VBA code in multiple workbooks Jon Microsoft Excel Programming 1 7th Jan 2004 04:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:05 PM.