I dont know much about macros myself or how to write them.
I basically want to be able to highlight X amount of cells (100 for example), then click a macro button that will copy the formulas and formatting from the row directly above them.
I found this.. however it doesn't quite copy the formatting properly. It copies the colour but not the border on all cells.
Sub InsertRowFormulas()
Application.ScreenUpdating = False
Dim cell As Range
Selection.EntireRow.Insert
For Each cell In Intersect(ActiveSheet.UsedRange, Selection.Offset(-1, 0).EntireRow)
If cell.HasFormula Then
cell.Copy cell.Offset(1, 0)
End If
Next
Application.ScreenUpdating = True
End Sub
Any ideas on how to fix this??? It copies the formulas as wanted.
gonzalraf
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks