VBA code to open a new workbook and add data to it


 Sub CreateNewWorkbook()

   Dim wb As Workbook

   Set wb = Workbooks.Add

   With wb.Sheets(1)

      .Range("A1") = "Name"

      .Range("B1") = "Age"

      .Range("A2") = "John"

      .Range("B2") = 30

   End With

End Sub


VBA code to open a new workbook and add data to it

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.