View Single Post
 
Old 12-01-2022, 12:49 PM
jjxxoo jjxxoo is offline Mac OS X Office 2021
Novice
 
Join Date: Dec 2022
Posts: 1
jjxxoo is on a distinguished road
Default Microsoft visual basic: Compile error expected end with

MICROSOFT VISUAL BASIC: COMPILE ERROR EXPECTED END WITH
I am expected to fix this code but am unsure how i keep rearranging things but get error codes and it wont let me run the code. If someone can help please.


Code:
Sub Formatting()
 
 ' Objective
 ' Name
 ' Date
 
    With Worksheets("Formatting")
        
        With .Range("A1")
            .Value = "Expenses For March"
            With .Font
                .Name = "Arial"
                .Bold = True
                .ColorIndex = 5
                .Size = 14
         End With
         
          With .Interior
                .ColorIndex = 2
            End With
            
            .HorizontalAlignment = xlLeft
        End With
        
        With Range("A3:A6")
            .InsertIndent 1
            With .Font
                .Italic = True
                .Bold = True
                .ColorIndex = 3
            End With
            
            With .Range("B3:B6")
                .Interior.ColorIndex = 37
                .NumberFormat = "$#,##0"
            End With
        
        End With 

End Sub
Reply With Quote