I have a spreadsheet with 12 columns, the last column is a date. I want to scan down this column and when the date changes, i want to insert an empty row. The empty row will be used to sum the columns for that day.
'Insert row above active cell
ActiveCell.EntireRow.Insert
'Insert row below active cell
ActiveCell.Offset(1).EntireRow.Insert
'Insert column to the left of the active cell
ActiveCell.EntireColumn.Insert
'Insert column to the right of the active cell
ActiveCell.EntireColumn.Offset(0, 1).Insert
End Sub
by
kumaresan
Microsoft Excel
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
try this
Sub InsertMania()
'Insert row above active cell
ActiveCell.EntireRow.Inser
'Insert row below active cell
ActiveCell.Offset(1).Entir
'Insert column to the left of the active cell
ActiveCell.EntireColumn.In
'Insert column to the right of the active cell
ActiveCell.EntireColumn.Of
End Sub
by
kumaresan