Forum Discussion

Excel's avatar
Excel
Iron Contributor
Jan 09, 2022
Solved

VBA

Hello Everyone,

How to show header in different columns with the help of VBA code?

 

like :

 

 

Please help..??

  • Excel 

    Sub Add_headers()

    With Sheets("Tabelle1")

    .Range("A1:E1").Value = Array("Region", "Expenses", "January", "February", "March")

    End With

    End Sub

     

    Maybe with above code if sheetname is "Tabelle1".

2 Replies

  • Excel 

    Sub Add_headers()

    With Sheets("Tabelle1")

    .Range("A1:E1").Value = Array("Region", "Expenses", "January", "February", "March")

    End With

    End Sub

     

    Maybe with above code if sheetname is "Tabelle1".

    • Excel's avatar
      Excel
      Iron Contributor
      It works.
      Thank you so much sir.