Results 1 to 3 of 3

Thread: Code added by VBA ends up on wrong sheet?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
        Set ReportCusts = Worksheets.Add(Before:=Sheets(1))
        'Application.OnTime Now() + TimeSerial(0, 0, 0), "AddCode"
        ReportList.VBProject.VBComponents(ReportCusts.CodeName).CodeModule. _
                AddFromString _
                "Private Sub Worksheet_Change(ByVal Target As Range)" & Chr(10) & _
                "    If Cells(1, Target.Column).Value = ""Select"" Then" & Chr(10) & _
       "         Target.Value = UCase(Target.Value)" & Chr(10) & _
                "    End If" & Chr(10) & _
                "End Sub"
    Last edited by Aussiebear; 03-29-2023 at 03:18 PM. Reason: Adjusted code tags
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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