+ Reply to Thread
Results 1 to 20 of 20

Specific worksheet upper case

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Specific worksheet upper case

    Hello,
    I have this code: see below.

    this part here: If Intersect(Target, Range("F:F")) Is Nothing Then
    I want to specify for Sheet3
    How do I redo the code that Sheet3 F:F is no upper auto.

    Thanks.


    Private Sub Workbook_SheetChange(ByVal _
                                     Sh As Object, ByVal Target As Range)
        On Error Resume Next
        Application.EnableEvents = False
        If Intersect(Target, Range("F:F")) Is Nothing Then
            Target = UCase$(Target)
        Else
            Target = StrConv(Target, vbProperCase)
        End If
        Application.EnableEvents = True
    End Sub
    
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
        ActiveCell.FormatConditions.Delete
    End Sub

  2. #2
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    What I meant except Column F:F Sheet3

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,016

    Re: Specific worksheet upper case

    .
    .
    Paste this in the Sheet Level Module :

    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
        Application.EnableEvents = False
        If Intersect(Target, Range("F:F")) Is Nothing Then
            Target = UCase$(Target)
        End If
        Application.EnableEvents = True
    End Sub

  4. #4
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    Hi
    I already had the code placed in thisworkbook. It works will all the worksheet.
    Don’t have I specify the sheet that i want to exclude? I dont want an auto upper case on my worksheet Sheett3 in entire column F.

    Tha ks

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

    Re: Specific worksheet upper case

    How about
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
       If Sh.Name = "Sheet3" Then Exit Sub
        Application.EnableEvents = False
        If Intersect(Target, Sh.Range("F:F")) Is Nothing Then

  6. #6
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    Logit

    Can this be work in workbook instead worksheet?

    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next
        Application.EnableEvents = False
        If Intersect(Target, Range("F:F")) Is Nothing Then
            Target = UCase$(Target)
        End If
        Application.EnableEvents = True
    End Sub

  7. #7
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    Hi guys,
    I think I got it. But when I put "F:F" it does not work.

    See this code:
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    
    On Error Resume Next
    Application.EnableEvents = False
    
    If Sh.Name = "Sheet1" And Target.Address = "F:F" _
    Then
        Target = StrConv(Target, vbProperCase)
    Else
        Target = UCase$(Target)
    End If
    
    On Error GoTo 0
    Application.EnableEvents = True
    
    End Sub

  8. #8
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    I tried this too but no luck.

    If Sh.Name = "Sheet3" And Target.Address = "$F$:$F$" _

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

    Re: Specific worksheet upper case

    Do you want it to exclude sheet3 completely?
    If so just add the line I showed in post#5

  10. #10
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    I don't want to exclude Sheet3. I just want to exclude Column F in Sheet3 but the rest will be an auto upper case I had the F:F Sheet3.

    This code might work but if I work it with a specific cell then it work. Let say $F$1 it works fine.

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    
    On Error Resume Next
    Application.EnableEvents = False
    
    If Sh.Name = "Sheet1" And Target.Address = "F:F" _
    Then
        Target = StrConv(Target, vbProperCase)
    Else
        Target = UCase$(Target)
    End If
    
    On Error GoTo 0
    Application.EnableEvents = True
    
    End Sub

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,016

    Re: Specific worksheet upper case

    .
    It sounds like you want auto-capitalize for all Sheets, all columns, EXCEPT for SHEET 3, Column F.

    Is that correct ?

  12. #12
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    Hi

    Yes, you got it. : o)

  13. #13
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    Something like this:

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    
    On Error Resume Next
    Application.EnableEvents = False
    
    If Sh.Name = "Sheet3" And Target.Address = "F:F" _
    Then
        Target = StrConv(Target, vbProperCase)
    Else
        Target = UCase$(Target)
    End If
    
    On Error GoTo 0
    Application.EnableEvents = True
    
    End Sub

  14. #14
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    but like I said when I typed F:F on the code it does not work. But if I use $F$1 for cell itself works.

  15. #15
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,016

    Re: Specific worksheet upper case

    .
    If the macro he submitted works .. why are you changing it to : $F$1 ???

  16. #16
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    No, I was actually trying to change to F:F.

    Maybe my code was wrong.

  17. #17
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    Like you said Logit
    "It sounds like you want auto-capitalize for all Sheets, all columns, EXCEPT for SHEET 3, Column F."
    This is correct. This is what I want to happen but the codes does not work at all.

    Thanks.

  18. #18
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,016

    Re: Specific worksheet upper case

    .
    I believe this works ...

    Option Explicit
    
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    On Error Resume Next
        Application.EnableEvents = False
        
        If Intersect(Target, Sheet3.Range("F:F")) Is Nothing Then
            Target = UCase$(Target)
        End If
        Application.EnableEvents = True
    
    End Sub

  19. #19
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,736

    Re: Specific worksheet upper case

    Yay! Perfect!

    Thank you Logit and thank you too Fluff13

  20. #20
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,016

    Re: Specific worksheet upper case

    .
    You are welcome.

+ 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. Upper Case excluding specific worksheet
    By RJ1969 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2019, 12:05 AM
  2. [SOLVED] Auto upper case does not include specific cell
    By RJ1969 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-17-2019, 09:43 PM
  3. [SOLVED] Pasting text into a cell that has Upper Case code for the worksheet
    By rlh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-05-2014, 12:17 PM
  4. Write a subroutine in a module to change case upon exit of a cell to upper case
    By Stephd22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2013, 06:39 PM
  5. [SOLVED] Auto upper case for specific range of cells
    By giligancow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2013, 12:21 PM
  6. Replies: 14
    Last Post: 08-25-2005, 10:05 PM
  7. [SOLVED] How do I convert all upper case excel sheet into upper and lower .
    By DebDay in forum Excel General
    Replies: 1
    Last Post: 03-09-2005, 05:06 PM

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