Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Copy format of row above my activecell

Thxs,
Is there an alternative code which will filldown format only of my
selection

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy File from activecell FIRSTROUNDKO via OfficeKB.com Excel Discussion (Misc queries) 1 December 13th 06 09:21 PM
ActiveCell Format Same as Target.Address Format Paige Excel Programming 2 October 27th 05 09:57 PM
ActiveCell.Copy Range("R3C27") Stuart Grant New Users to Excel 2 September 30th 05 09:00 AM
ActiveCell.Value changes with Format? Sige Excel Programming 7 September 23rd 05 01:42 PM
Copy named range contents to activecell position Neal Excel Programming 2 October 28th 04 02:20 PM


All times are GMT +1. The time now is 04:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"