Results 1 to 5 of 5

Quick Question about applying macro to multiple sheets

Threaded View

  1. #1
    Registered User
    Join Date
    10-17-2013
    Location
    Subotica, Serbia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Quick Question about applying macro to multiple sheets

    Is there a way to run the codes below on every sheet in my workbook?

    Sub vs()
        Dim Rng As Range
        On Error Resume Next
        Err.Clear
        Application.EnableEvents = False
        For Each Rng In Selection.SpecialCells(xlCellTypeConstants, _
                 xlTextValues).Cells
            If Err.Number = 0 Then
                 Rng.Value = StrConv(Rng.Text, vbUpperCase)
               ' Rng.Value = StrConv(Rng.Text, vbLowerCase)
               ' Rng.Value = StrConv(Rng.Text, vbProperCase)
            End If
        Next Rng
        Application.EnableEvents = True
    
    End Sub
    
    
    or :
    
    Public Sub Priority()
       Dim s as String
       Dim cell as Range
       For Each cell In Selection
           s = cell.Text
         select case s
    
          case "EXAMPLE 1"
           Cell.Value = "EXAMPLE A"
          case "EXAMPLE 2"
           Cell.Value = "EXAMPLE B"
          case "EXAMPLE 3"
           Cell.Value = "EXAMPLE C"
          case "EXAMPLE 4"
           Cell.Value = "EXAMPLE D"
    
          End Select
       Next cell
    End Sub
    THANKS
    Last edited by arlu1201; 10-17-2013 at 02:01 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Quick Question about switching sheets through VBA code
    By richter394 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2013, 02:27 PM
  2. Applying a macro to multiple sheets
    By swallis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2011, 01:36 AM
  3. Applying a filter to multiple sheets
    By LemonTwist in forum Excel General
    Replies: 2
    Last Post: 07-15-2008, 04:49 AM
  4. Applying Protection To Multiple Sheets
    By Mhz in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 07-06-2006, 08:25 AM
  5. quick charting question for similar charts on multiple sheets
    By Boon8888 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-27-2006, 03:40 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