Consulting

Results 1 to 3 of 3

Thread: To Uppercase

  1. #1
    VBAX Regular
    Joined
    Nov 2011
    Location
    Houston, TX
    Posts
    27
    Location

    Question To Uppercase

    Greetings,

    I am trying to convert an array of cells to Uppercase. I don't understand why this isn't working.

    Function ToUppercase()
    
    
        Dim CellsToCap As Variant
        Dim varCell As Variant
    
    
        Application.ScreenUpdating = False
        
        'Capitalize these cells.
        With ActiveWorkbook.Worksheets("Lists")
            
           CellsToCap = Array("J3", "J5", "J7", "J9", "J11", "J13")
    
    
        For Each varCell In CellsToCap
            With .Range(varCell)
               .Value = UCase(varCell.Value)
            End With
    
    
        Next varCell
    
    
        End With
        
         Application.ScreenUpdating = True
    
    
    End Function
    I appreciate any help you can provide.
    Dragon

    "You don't need to take a person's advice to make them feel good; just ask for it." ~ Laurence J. Peter

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    .Value = UCase(.Value)

  3. #3
    VBAX Regular
    Joined
    Nov 2011
    Location
    Houston, TX
    Posts
    27
    Location
    That worked. Thanks.
    Dragon

    "You don't need to take a person's advice to make them feel good; just ask for it." ~ Laurence J. Peter

Posting Permissions

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