Not just simple copy and paste

Keebler

Board Regular
Joined
Dec 1, 2021
Messages
182
Office Version
  1. 2021
Platform
  1. Windows
so i have a collection of every evolving sets of data.
sometimes the data has merged cells, or merged cells with wrapped text, or just plain text.
what i need to learn how to do is to make a live (if possible) copy of the data to another part of the same sheet.

the setup
i have a range (a4:l48)
i need to have an exact copy (including formatting, merged cells, etc) made in range (m4:x48)
VBA is preferred but not required
my attempts to perform this so far have been using formulas and indexes -- it is cumbersome and does not copy formatting. only the text.
any help getting pointed in the correct direction would be greatly appreciated :) thank you
 
Try something simple like this:
VBA Code:
 ActiveSheet.Range("A4:I48").Select
    Selection.Copy
    ActiveSheet.Range("m4").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Selection.PasteSpecial xlPasteColumnWidths

I didn't see your file, but it should work.

Regards,
GB
 
Upvote 0
Solution
What isn't being copied with a normal copy/paste (not values) other than column widths.

Edit: Nevermind: test the code @rowebca has posted first before answering
 
Upvote 0
worked great!
if there were any errors - they were undecernable - THANK YOU
even copied the colors, --- excellent thank you

it did not copy the "images" that were drawn.. ill upload my worksheet one moment please
 
Upvote 0
the sheet upload did NOT copy the formatting, nor the images... ill try a screenshot - -

FULLY DEVOTED.xlsm
ABCDEFGHIJK
4Complete the following statements for the first thing that comes to mind:
5Without food, I am
6Without sleep, I am
7Without Jesus, I am
8
9It has been said that the first step to dealing with the problem is admitting you have one. Think about this: when you're tired and hungry, you feel the effects and look to correct the problem quickly, right? A spiritual deficiency, though, can often be misunderstood, overlooked, or altogether ignored.
10
11
12We need to understand our dilemma without Christ. We tend to think were pretty bad off without Jesus but there's no real present danger. That's because we compare and categorize sins. We think about things like our Internet activity and reactions to other drivers and traffic as justifiable-after all, those aren't as bad as cheating on your spouse are murder. We start to think about people and categories that way too. If a neighbor or coworker seems like a pretty good guy, or not too worried about a soul.
13
14
15
16
17In essence, what we are saying when we categorize and compare sins in that way is, I don't think God really cares about this particular issue. It's small stuff-not a big deal. And we grow apathetic about our own particular brand of sin.
18
19But, Scripture tells a different story.
202 And you were dead in your trespasses and sins 2 in which you previously walked according to the ways of this world, according to the ruler of the power of the air, the spirit now working in the disobedient.[a] 3 We too all previously lived among them in our fleshly desires, carrying out the inclinations of our flesh and thoughts, and we were by nature children under wrath as the others were also.
21
22
23
24Ephesians 2:1-3
25How does Ephesians to describe you and everyone you know?
26"Pretty bad off" without Jesus
27Under God's wrath and completely dead without Jesus
28
29Why is it critical that you understand the depth of helplessness that defines all people apart from Christ?
30
31
32We need to make a shift in our thinking. Sin isn't pretty bad-it kills the life God created us to have. Without Jesus, life isn't less than ideal-it's completely futile. Without understanding the depth of our need, there is no urgency or desperation for forgiveness and redemption.
33
34
35Do you think of yourself as someone desperate need of forgiveness? Why or why not?
36
37
38Do you think of the people we encounter each day as sinners in desperate need of forgiveness? Why or why not?
39
40
41
42You can't be fully devoted to Christ unless you know who you are without him. Who you are without him is someone with a problem that cannot be fixed. You are dead in your sins, whatever those sins are. All of us are. You need Jesus to save you. All of us do. He's the answer we desperately need.
43
44
45What would you say to someone who says, "God knows I'm going to sin, so I might as well just live how I want and ask forgiveness later"?
46
47
48
WK02DY01
 
Upvote 0
here is a screenshot, its greyed because this was "selected"
 

Attachments

  • New Picture (1).jpg
    New Picture (1).jpg
    113.1 KB · Views: 4
Upvote 0
I really don't understand, what pictures? Regarding formats I see that everything is correct. Really you need to give more information.

Regards,
GB
 
Upvote 0
im sorry, the squares a little bit more than half way down
if they can not be copied, thats fine.
nevermind, im being picky... thank you- what you have done is perfect.. im sorry
please disregard.. im sorry- i do not know how to remove my complaint here
 

Attachments

  • New Picture (1)b.jpg
    New Picture (1)b.jpg
    12.4 KB · Views: 4
Upvote 0
I see it, are those squares pictures? If yes change the script:

VBA Code:
 ActiveSheet.Range("A4:I48").Select
Application.CopyObjectsWithCells = True
    Selection.Copy
    ActiveSheet.Range("m4").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Selection.PasteSpecial xlPasteColumnWidths

Regards,
GB
 
Upvote 0

Forum statistics

Threads
1,226,771
Messages
6,192,924
Members
453,767
Latest member
922aloose

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top