|
-
Feb 23rd, 2006, 04:07 AM
#1
Thread Starter
Hyperactive Member
Format lost after pasting range
I lost my formatting after pasting a range from another sheet w/in a workbook into an other sheet. Here's my code:
VB Code:
shtSrc.Range("A1:Z10").Copy
shtDest.Range("A" & nS).PasteSpecial xlPasteAll
Set rangeX = shtDest.Range("A" & nS & ":L" & nE)
I had successfully copied all the data and the formula except the formatting. Thanks in advance!
Last edited by dRAMmer; Mar 1st, 2006 at 07:58 PM.
live, code and die...
-
Feb 23rd, 2006, 04:16 AM
#2
Re: Format lost after pasting range
Looks like it should be pasting all which includes xlPasteFormats. If you change it from xlPasteAll to xlPasteFormats will it at least paste the formats that you have lost?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 23rd, 2006, 09:00 AM
#3
Frenzied Member
Re: Format lost after pasting range
dRAMmer ...
Selection.Paste or Selection.PasteSpecial Paste:=xlPasteAll should copy the formatting from the source and override any previous formatting in the destination. Exactly what Format properties aren't getting copied correctly from the source to the destination?
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Feb 23rd, 2006, 07:45 PM
#4
Thread Starter
Hyperactive Member
Re: Format lost after pasting range
Hi Rob! If I will only use xlPasteFormats no data will be copied, so what I did is to xlPasteAll first then xlPasteFormats afterwards, still nothing happened.
Webtest,
Mostly column merging.
Workaround: I don't want to do this as much as possible but if there's no solution for this, I will have to go to formatting the destination manually. Hope you can give some suggestions and possibly a solution. Thanks for the replies!
-
Feb 24th, 2006, 07:55 AM
#5
Frenzied Member
Re: Format lost after pasting range
From my previous post ...
 Originally Posted by Webtest
dRAMmer ...
...
Exactly what Format properties aren't getting copied correctly from the source to the destination?
...
Are you dealing with CONDITIONAL formatting???
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|