automatic replacing of vbe code for multiple workbooks

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 !!


0
Utf
11/17/2009 3:07:01 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
949 Views

Similar Articles

[PageSpeed] 15

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 !!
> 
> 
0
Utf
11/17/2009 4:25:01 PM
Reply:

Similar Artilces:

Moving sheets between workbooks
Hi group, More often than I like to admit I find that I have to move a chart into another workbook, maybe even onto another computer, with a slightly different file tree. Then all links get messed up, of course. Is there some clever way of telling Excel that now everything is righ here, in this very workbook, or such? Like "My Documents" are on E:, not C:! And what about macros. I have quite simple macros that are *in the workbook* where they will be used. Is there some way to tell Excel to "Look no further, forget about that other computer and that other file tree, everyt...

number setting for workbook e.g. i want , instead of . in number
I want my excel should display number in US format not i German format. How to change number display setting for whole excel file. Check out Start>Settings>Control Panel> Date, Time, Language, and Regional Options> Regional and Language Options>click 'Customize' button If this post helps click Yes --------------- Jacob Skaria "Rajesh" wrote: > I want my excel should display number in US format not i German format. > > How to change number display setting for whole excel file. ...

Message automatically deleted after opening
I am using Windows Mail in Vista 32 bit Home Premium. Recently I have been encountering a problem with my e-mails. I open an e-mail and close it after it is read. If I proceed to go to another folder and, then return to the Inbox, the message that I read is no longer there. It doesn't go to the Delete Folder or, any other folder that I have set up. Does anyone know why this is happening and, how I can fix it. Thanks. -- Floridaguy "Floridaguy" <Floridaguy@discussions.microsoft.com> wrote in message news:53C48531-DCA8-45BE-8C65-97B19E28B977@microsoft.c...

Custom dat & time code
Does anyone know if it's possible write a custom cell-format code that=20 would look like the one Excel provides (mm/dd hh:mm AM/PM) but sets the=20 time in red? I've tried "mm/dd [RED]hh:mm AM/PM," but whenever I save = it,=20 Excel moves the red bracket to the beginning of the code so the whole = thing=20 is red. Help! Any ideas? I don't think you can. You can't format formulas like this (character by character). And you can't format numbers this way, either. (Anyway, I couldn't do it.) Wuddus wrote: > > Does anyone know if it's possible ...

Automatic Send/Receive When Closed
I have Outlook 2002 and it used to send and recieve when I was not in the program itself. It was actually kind of handy. A little mail icon would show up in the system try to let me know email was there. It was great when I was doing other work. It was also good becuase when I am at the office, I can download my email when I sync my mobile device with my computer. How do I get that back? Any ideas? ...

How to: Open *.MSG File from Hard Drive via Code
I need to : Open *.MSG File from Hard Drive via Code and extract the file attachment. I have hundreds of these emails that we need the attachments extracted from. But the .msg files are on a hard drive. Someone help me out here.... I need the code to open and access the mailitem.... how do I open a .msg file? Use the CreateItemFromTemplate() method for that. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "B...

Selecting Multiple Cells.
I know how to select a range of cells by specifying reference in nam box. Examples: A10:A20 (The range of cells in column A and rows 10 through 20) 5:5 (All cells in row 5) However, I am attempting to select every third cell going down colum A, beginning with A3. I can enter A3, A6, A9 (This will select just those cells.) Is there a shortcut I can use to continue this pattern of every thir cell indefinitely? (I actually need to select every third cell down t A4950.) Thank you for any assistance -- Message posted from http://www.ExcelForum.com Here's one way: 1. Put this in ...

Help-Error validating multiple documents
Hello. I've got a total of 5 schemas. They are: 1 - 1.xsd - a description of a city 2 - 2.xsd - a description of a town 3 - CityHall.xsd - a description of a cityhall-meant to be part of a document based on 1.xsd in "user area". 4 - TownHall.xsd - a description of a townhall-meant to be part of a document based on 2.xsd in "user area". 5 - testmultischema.xsd - a document which combines in a batch instances of cities and towns based upon 1.xsd and 2.xsd. I get the following xml validation error: ERROR: The 'http://adamExt.org:TownHall' element is not declar...

Replacing Characters
I have a column (lets say column A) that has values like the following: 15467 12099 2099 1312 What I would like to do is make column B replace the last 2 characters with zeros so that column b looks like the following: 15400 12000 2000 1300 Can anyone help? Thanks in advance! Hi in B1 place =ROUNDDOWN(A1,-2) and copy this down for all rows -- Regards Frank Kabel Frankfurt, Germany "Jenn" <Jenn@discussions.microsoft.com> schrieb im Newsbeitrag news:98032363-0DD8-4C4A-8C18-1C86C6DC2F8C@microsoft.com... > I have a column (lets say column A) that has values like the follow...

How to make a 'automatic mail rule installer'
Hi, I wrote a mail rule and want to distribute it to my friends. but I think it will be nicer if the mail rule can be installed with just one click. How can I make it? If 'visual script' is an answer, which object shoud I create? Or Where can I find the reference or sample? I'll be very appreciate if you give me just a hint. More explanation on my question. Maybe the expression 'wrote' in "I wrote a mail rule" is distracting. 'mail rule' means the rule which can be made through the menu 'tools' , which is usually used for filtering, forwar...

Multiple Column Sorting
I've been reading online about sorting multiple columns and I'm confused. Selecting one column to sort also selects all the other columns as well, at least in Excel 2000 and XP. I didn't see any difference in selecting one column or using the "Then by" boxes, in fact, the "Then by" choices didn't work. If the first column sorted in ascending order, and I chose to sort the second and third columns to sort in descending order, Excel still sorted all three columns in ascending order. If Excel sorts the all the columns together by default, why use the "Then...

editing cells automatically???
Why is it that some spreadsheets will not allow you to edit cells automatically when tabbing between windows? i.e. some spreadsheets will require you to double click in the cell to continue editing once you navigate away from that spreadsheet. Not too clear on your problem but............ Is it possible you have separate instances of Excel running with different editing options? Gord Dibben MS Excel MVP On Thu, 13 May 2010 14:25:01 -0700, yogiiyogee <yogiiyogee@discussions.microsoft.com> wrote: >Why is it that some spreadsheets will not allow you to edit cell...

Money 2005
Option to start statement download when the program starts does not work. I have to manually click the circle with the arrows button. What is wrong with the setup? I think this may be a WinXP issue... I was using Money 2005 with Win98SE and automatic updates worked (or at least happened) but recently upgraded to WinXP SP2 and now I too have to manually click the "Update Now" option... I have also noticed that some settings do not get saved between Money sessions... for example, the Update Status Dialog that has the "Hide this window during update" checkbox... well...

Multiple Spin-off
Hi, I have a question for how to create a transaction for a multiple spin-off. First, my set up, I'm using Microsoft Money 2007 deluxe and running Windows XP home edition. Tyco recently spun off two companies, Tyco Electronics [29.23%] and Covidien [31.75%], when I try to use the spin-off utility in Money it doesn't give me the option for multiple spin-offs. The first thing I tried was to perform one spin-off to a bogus name that combined the two companies [60.98%]. I was then going to spin the two companies off from the bogus company. However, that seamed to consume all the c...

Multiple Products
Hi I would just like to ask if anyone is aware of whether or not you can add multiple line items when using the mail merge functionality in Version 4. Thanks Mark ...

Figured out Search/Replace Problem
Thanks, anyway! ...

Shard workbooks
Hi all I have a question with regards to shared workbooks. If i share out a workbook with auto update every # mins i'm assuming this will save my changes at # time. Does this save any autofilters i have also so the next person to open the file see's just the filtered info???? Cheers Paul -- It''''''''''''''''s Just a ride The Auto Update does save all changes made between the time frame of each Update. My experience with the AutoFilter is that it is User Specific. Each user can Filter on the info he/she wants. Wh...

combobox code
i can't get the following listfillrange code to work more than once ='g:\[data.xlsx]sht'!a1:c66. after the excel file is saved and closed the listfillrange changes to [data.xlsx]sht'!a1:c66. what is causing this to happen swain.s@blueyonder.co uk;592206 Wrote: > i can't get the following listfillrange code to work more than once > ='g:\[data.xlsx]sht'!a1:c66. > > after the excel file is saved and closed the listfillrange changes to > [data.xlsx]sht'!a1:c66. > > what is causing this to happen I thought it'd be t...

Activity Appointment Closed automatic
When I have an activity that is an appointment, it seems that there is an automatic mechanism that closes the activity next Day. So, users cannot change anything on that activity. All fields are disabled as it must be on a closed activity. But usually users, want to comment their appointments the next day they saw up at office. The only thing they can do is to add Notes, but this is not what they actually want to do. Is there any way to find and change the funtion that closes activities that are appointments next day after the scheduled time ? Regards Elias Kitsopoulos Login Ltd Software De...

Incident should be create automatically like c360 products
With any parameters or config, Incidents should be created automatically like EmailToCase c360 product. Thanks! ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=7b9224b9-28b...

Problem wih Code
I have the code below which simply just copies rows 18:21 to 9 ranges below it. My sheet is protected with the word FIELD. Everytime I run the macro I get an error "Paste Method Worksheet Class Failed", when I debug it highlights the line "ActiveSheet.Paste" - the first instance of this line. Can anyone assist? Thanks Sub CopyCells() Sheets("Report").Select ActiveSheet.Unprotect Password:="FIELD" ClearCells ActiveSheet.Unprotect Password:="FIELD" Sheets("Report").Select Rows("18:21").Select...

Count rows based on multiple criteria
I have a need to count the number of rows in an Excel spreadsheet based on contents of multiple cells. The formula is on one worksheet and all data is on a second worksheet. IE: count all rows that have the word "Windows" in column B and the word "Complete" in column G. Have not been able to figure this out with common functions like count, countif, dcount, etc. Help appreciated. -- DMG IT Professional Search for SUMPRODUCT or SUMIFS if you use XL-2007 "dmg" wrote: > I have a need to count the number of rows in an Excel spreadshee...

FRx Book Code/Attribute Category
In the Column Headings should be able to use a code that picks up the Book Code so one knows what Budget ID the column refers to. This is because it is hardcoded into the report and someone may have changed in Designer and another user may be unaware that the Budget info displayed relates to a prior year etc. Or another alternative would be to specify the Budget ID at run time. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If ...

Automatic refresh grid
When our support people are trying to monitor queues it is not very practical to expect them to continue pressing the refresh button every few minutes. Is there any method to automatically refresh the grid? Any help would be greatly appricated This is not supported way. http://localhost/workplace/home_workplace.aspx if you look at the code in that page and the code below you will see the line of code used to force the page to refresh eveyr 5 seconds. Note that modifying pages like this is unsupported. Inherits="Microsoft.Crm.Web.Workplace.HomeWorkplacePage" CodeBehind="M...

span a table to multiple pages
Hi, I have a very long table with 300+ rows. Instead of adding a new table to every pages, is there a command to "span" the one table to multiple pages? Thanks! Not in Publisher. Publisher only allows 128 rows per page. Word has this capability. -- Mary Sauer http://msauer.mvps.org/ "Tom" <nospam@yahoo.com> wrote in message news:u1WmV9bHJHA.1940@TK2MSFTNGP03.phx.gbl... > Hi, > > I have a very long table with 300+ rows. Instead of adding a new table to > every pages, is there a command to "span" the one table to multiple pages? >...