Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Formating lost when cut and insert

Greetings all. I have a workbook with one sheet for every month of the year.
I often have to cut a row out of one sheet and insert it into another sheet.
I have conditional formatting that is the same on each sheet, that I used
formatconditional formatting to enter. The problem is that every time I
move a row to a different sheet, the conditional formatting is lost. Is
there a way I can add the contitional formatting to the macro that moves the
row? The macro, when run, cuts the highlighted row, inserts it into the new
sheet, then resorts the new sheet and puts the value lists back in the proper
place. Can I add code to set conditional formatting in a macro? Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Formating lost when cut and insert

Hi

Copy the formatting from another cell with the desired formatting:

Sub test()
TargetRow = 5
Rows(1).Copy ' Row with desired formatting
Rows(TargetRow).PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub


Regards,
Per

"Greg Snidow" skrev i meddelelsen
...
Greetings all. I have a workbook with one sheet for every month of the
year.
I often have to cut a row out of one sheet and insert it into another
sheet.
I have conditional formatting that is the same on each sheet, that I used
formatconditional formatting to enter. The problem is that every time I
move a row to a different sheet, the conditional formatting is lost. Is
there a way I can add the contitional formatting to the macro that moves
the
row? The macro, when run, cuts the highlighted row, inserts it into the
new
sheet, then resorts the new sheet and puts the value lists back in the
proper
place. Can I add code to set conditional formatting in a macro? Thank
you.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Formating lost when cut and insert

Thanks Per, I don't know why I did not think of that, but it seems to work.
Thanks, and have a great holiday.

"Per Jessen" wrote:

Hi

Copy the formatting from another cell with the desired formatting:

Sub test()
TargetRow = 5
Rows(1).Copy ' Row with desired formatting
Rows(TargetRow).PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
End Sub


Regards,
Per

"Greg Snidow" skrev i meddelelsen
...
Greetings all. I have a workbook with one sheet for every month of the
year.
I often have to cut a row out of one sheet and insert it into another
sheet.
I have conditional formatting that is the same on each sheet, that I used
formatconditional formatting to enter. The problem is that every time I
move a row to a different sheet, the conditional formatting is lost. Is
there a way I can add the contitional formatting to the macro that moves
the
row? The macro, when run, cuts the highlighted row, inserts it into the
new
sheet, then resorts the new sheet and puts the value lists back in the
proper
place. Can I add code to set conditional formatting in a macro? Thank
you.



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
lost insert hyperlink option on right click gigi6d Excel Discussion (Misc queries) 2 March 15th 09 04:45 PM
Office 2007-Source formating lost when emailing from excel csi.sec Excel Discussion (Misc queries) 4 February 6th 07 07:24 AM
Office 2007-Source formating lost when emailing from excel csi.sec Excel Discussion (Misc queries) 0 February 5th 07 04:47 AM
lost option to insert comment, need it back? eclifford Excel Worksheet Functions 1 May 5th 06 04:35 PM
Ensuring Conditional formating is not lost [email protected] Excel Programming 4 March 10th 05 01:51 PM


All times are GMT +1. The time now is 11:51 AM.

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"