Results 1 to 5 of 5

VBA: Change content of each sheet in an workbook

Threaded View

  1. #1
    Registered User
    Join Date
    09-12-2012
    Location
    Gothenburg
    MS-Off Ver
    Excel 2003
    Posts
    3

    VBA: Change content of each sheet in an workbook

    Hello.

    I am new to this forum and hope for a little help.

    I have searched the forum have, to my surprise, not found anything quite similar to my request. Perhaps it is too obvious?

    For every sheet in a workbook, I would like to replace cell contents. It is always the same for each sheet and the structure of each sheets is the same.


    I tried some permutations of the following syntax but to no avail.

    Sub test()
    
    For Each ..... In .....
           cells(1,1)="New message"
           cells(1,2)=<formula>
    Next
    End Sub
    Now there are two questions:
    1. What should I use to replace the ..... ?
    2. How do I specify a formula (where formula I want in C5 could be "=if($C$1="OK"; A5+B5; 0)" ?
    Edit: Figured the second one out.

    Extra bonus: How to do this for all workbooks in a directory or in the current directory.

    Optionally: If it is simpler, it is OK to copy a range from a template and paste into all sheets.

    Best regards
    Last edited by bongus; 09-12-2012 at 06:23 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1