pedro-egoli
Well-known Member
- Joined
- Apr 25, 2004
- Messages
- 1,217
- Office Version
- 2016
- Platform
- Windows
Just need some assistance to tidy up this macro , which is intended to clear data in cells B4:B7 in worksheet "test".
My code below simply leaves old data and places new data in adjoining column.
Any assistance appreciated , as I have combined a couple of codes , one which was obtained here and one from the net
My code below simply leaves old data and places new data in adjoining column.
VBA Code:
Sub Centrelink()
Sheets("accountbalance").Range("d9:d12").Copy
Sheets("test").Cells(4, Columns.Count).End(xlToLeft).Offset(, 1).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.CutCopyMode = False
Selection.NumberFormat = "$#,##0.00"
Selection.NumberFormat = "$#,##0.0"
Selection.NumberFormat = "$#,##0"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Updated by Extendoffice 20190712
Worksheets("test").Range("B4:B7").Value = ""
End Sub