Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am using the following code to copy cells from page to page.
I would like them to match "Home Page" formatting. How can I do this? If .Cells(r, 7) = 2 Then Set cophyp = .Cells(r, 4) With Worksheets("Home Page") Set DestCell = .Cells(.Rows.Count, "G").End(xlUp).Offset(1, 0) cophyp.Copy Destination:=DestCell End With End If Thx, Jeff |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Use PasteSpecial (vaues) as below....Note that one line is remarked
If .Cells(r, 7) = 2 Then Set cophyp = .Cells(r, 4) With Worksheets("Home Page") Set DestCell = .Cells(.Rows.Count, "G").End(xlUp).Offset(1, 0) 'cophyp.Copy Destination:=DestCell cophyp.Copy destcell.PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False End With End If If this post helps click Yes --------------- Jacob Skaria "Jeff S." wrote: I am using the following code to copy cells from page to page. I would like them to match "Home Page" formatting. How can I do this? If .Cells(r, 7) = 2 Then Set cophyp = .Cells(r, 4) With Worksheets("Home Page") Set DestCell = .Cells(.Rows.Count, "G").End(xlUp).Offset(1, 0) cophyp.Copy Destination:=DestCell End With End If Thx, Jeff |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() orIf .Cells(r, 7) = 2 Then Set cophyp = .Cells(r, 4) With Worksheets("Home Page") Set DestCell = .Cells(.Rows.Count, "G").End(xlUp).Offset(1, 0) DestCell.Value = cophyp.Value End With End If -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125922 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Neither of these solutions (yours or the one below yours) transfers a
hyperlink in the cell properly but the formatting works. Any more thots? "Jacob Skaria" wrote: Use PasteSpecial (vaues) as below....Note that one line is remarked If .Cells(r, 7) = 2 Then Set cophyp = .Cells(r, 4) With Worksheets("Home Page") Set DestCell = .Cells(.Rows.Count, "G").End(xlUp).Offset(1, 0) 'cophyp.Copy Destination:=DestCell cophyp.Copy destcell.PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False End With End If If this post helps click Yes --------------- Jacob Skaria "Jeff S." wrote: I am using the following code to copy cells from page to page. I would like them to match "Home Page" formatting. How can I do this? If .Cells(r, 7) = 2 Then Set cophyp = .Cells(r, 4) With Worksheets("Home Page") Set DestCell = .Cells(.Rows.Count, "G").End(xlUp).Offset(1, 0) cophyp.Copy Destination:=DestCell End With End If Thx, Jeff |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Neither of these solutions (yours or the one below yours) transfers a hyperlink in the cell properly but the formatting works. Any more thots?Can I clarify; do you *just *want to copy hyperlinks (working) over? This would simplify things a lot. -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125922 |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yes. Sorry I wasn't clear about that from the start. Copy and paste cells
containing hyperlinks to match destination formatting. Thanks. "p45cal" wrote: Neither of these solutions (yours or the one below yours) transfers a hyperlink in the cell properly but the formatting works. Any more thots?Can I clarify; do you *just *want to copy hyperlinks (working) over? This would simplify things a lot. -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125922 |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() If *only *the hyperlinks (there may be more than one per cell) then try:If .Cells(r, 7) = 2 Then Set cophyp = .Cells(r, 4) With Worksheets("Home Page") Set DestCell = .Cells(.Rows.Count, "G").End(xlUp).Offset(1, 0) If cophyp.Hyperlinks.Count 0 Then For i = 1 To cophyp.Hyperlinks.Count With cophyp.Hyperlinks(i) Worksheets("Home Page").Hyperlinks.Add Anchor:=DestCell, Address:=.Address, TextToDisplay:=.TextToDisplay End With Next i End If End With End If -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125922 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically match destination formatting? | Excel Discussion (Misc queries) | |||
How do I copy borders without erasing other destination formats? | Excel Discussion (Misc queries) | |||
.Copy Destination:= << Forget when PasteValues is desired | Excel Discussion (Misc queries) | |||
Destination formatting 2000? | Excel Discussion (Misc queries) | |||
VBA .copy destination | Excel Discussion (Misc queries) |