Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format of row above my activecell
I would like to copy format of row above my activecell with macro
below: Sub Macro4() ' ' Macro4 Macro ' Macro recorded 09-12-2005 by Albert Ng ' ActiveCell.Offset(RowOffset:=-1, columnOffset:=0).EntireRow.Select Selection.Copy ActiveCell.EntireRow.Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False End Sub But it's not working - can anybody help please. Thxs |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format of row above my activecell
You are currently copying the format of the row above the activecell
over itself. Try: Sub Macro4() Dim rng As Range Set rng = ActiveCell Rows(rng.Row - 1).Copy Cells(rng.Row, 1).PasteSpecial Paste:=xlPasteFormats Application.CutCopyMode = False rng.Select End Sub Hope this helps Rowan al007 wrote: I would like to copy format of row above my activecell with macro below: Sub Macro4() ' ' Macro4 Macro ' Macro recorded 09-12-2005 by Albert Ng ' ActiveCell.Offset(RowOffset:=-1, columnOffset:=0).EntireRow.Select Selection.Copy ActiveCell.EntireRow.Select Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False End Sub But it's not working - can anybody help please. Thxs |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format of row above my activecell
Thxs,
Is there an alternative code which will filldown format only of my selection |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format of row above my activecell
How can you modify you code to make it work for a selection containing
more than 1 row (instead of the active cell) |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format of row above my activecell
This adds 5 blank formatted lines to the botto. If this is similar to what
you are after? use it with my blessing. Lou Public Sub AddBlankLines() ' Add Blank Lines Macro Worksheets("Recall").Select range("A1").Select ActiveSheet.Unprotect Rows("2:6").Select Selection.Copy Selection.End(xlDown).Select ActiveCell.Offset(1, 0).Select ActiveSheet.Paste ActiveCell.Offset(0, 1).Select Selection.Resize(5, 35).ClearContents ActiveSheet.Protect End Sub "al007" wrote: How can you modify you code to make it work for a selection containing more than 1 row (instead of the active cell) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy File from activecell | Excel Discussion (Misc queries) | |||
ActiveCell Format Same as Target.Address Format | Excel Programming | |||
ActiveCell.Copy Range("R3C27") | New Users to Excel | |||
ActiveCell.Value changes with Format? | Excel Programming | |||
Copy named range contents to activecell position | Excel Programming |