Hello! I need to write in VBA In column B of all sheets in this workbook Move all data down 1 row.
Can anyone help? Thank you!!
VBAMicrosoft ExcelMicrosoft Office
Last Comment
Bill Prew
8/22/2022 - Mon
Fabrice Lambert
Maybe something like the following:
Option ExplicitPublic Sub test() Dim Wb As Excel.Workbook Set Wb = ThisWorkbook Dim Ws As Excel.Worksheet For Each Ws In Wb.Worksheets MoveData Ws.Columns("B"), 1 NextEnd SubPrivate Sub MoveData(ByRef Column As Excel.Range, ByVal RowOffset As Long) Dim Ws As Excel.Worksheet Set Ws = Column.Parent Dim Rng As Excel.Range Set Rng = Ws.Range(Column.Cells(1), Column.Cells(Column.Cells.Count).End(xlUp)) Rng.Copy Rng.Offset(RowOffset:=RowOffset).PasteSpecial xlPasteAll Column.Cells(1).ClearEnd Sub
Open in new window