+ Reply to Thread
Results 1 to 6 of 6

Edit VBA script to work in multiple specific sheets instead of just one

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Edit VBA script to work in multiple specific sheets instead of just one

    Hello friends,
    The VBA below works for the sheet with the module attached (it converts all data entered in the listed range to ucase). I have a Workbook (MyWorkbook) with ten sheets, named: One, A, Two, B, Three, C, Four, D, Five, E. I want this VBA to work in each of the lettered sheets: A-E, but only those sheets. I don't want to have to create a module with this script in it for each of the 5 sheets.

    Can someone show me how it can be changed to work in all 5 of the sheets desired?
    THANKS!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Edit VBA script to work in multiple specific sheets instead of just one

    How about
    Please Login or Register  to view this content.
    This needs to go in the ThisWorkbook module

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Edit VBA script to work in multiple specific sheets instead of just one

    Hi

    I suppose you need one Private Sub Worksheet_Change for each Worksheet, because the event is design for a Worksheet not for a collection of Worksheets.

    I do not know but try

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range).

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Edit VBA script to work in multiple specific sheets instead of just one

    Thank you very much - that's what it took - so simple (when you know what you're doing).

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Edit VBA script to work in multiple specific sheets instead of just one

    You're welcome & thanks for the feedback

  6. #6
    Forum Contributor
    Join Date
    06-08-2012
    Location
    Panama City, FL
    MS-Off Ver
    Excel 2016
    Posts
    175

    Re: Edit VBA script to work in multiple specific sheets instead of just one

    Thanks for taking the time to reply. Turns out the fella who replied immediately before you solved my problem. It took what you offered PLUS one more IF THEN line of code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Edit specific objects in protected work sheet
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2020, 04:23 AM
  2. populate a list on one work sheet from multiple work sheets that meet a criteria
    By Kelly Linton-Selkirk in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-21-2015, 03:56 PM
  3. [SOLVED] Edit a script to work with Column G instead of A
    By Mr_Bill in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2014, 11:31 PM
  4. [SOLVED] help edit vba to work on multiple ranges
    By tlacloche in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-24-2013, 11:37 AM
  5. Trying to edit a master timesheet to spread across all other sheets in work book.
    By dark91zc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-06-2013, 02:02 PM
  6. [SOLVED] Cannot edit macro to work on multiple cells
    By eliasli in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-09-2012, 01:12 PM
  7. Edit Script not to look at one of my sheets
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2008, 01:35 PM

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