Fundemental Change in Thinking to Select a Column to Copy and Paste

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
982
Office Version
  1. 2021
Platform
  1. Windows
Code:
Range("C4:C5000").Copy
Range("G4:G5000").Select
Selection.PasteSpecial Paste:=xlPasteValues

Hello All...
I use the term Fundamental in the title, because I've always used a Column number to find the column I wanted to work on.
In the above code, I use Column C because the heading of C4 is the data I wish to copy and move.
Instead, is there a way to find the heading word in any column to choose that column to work with.
For example, what if C4 has a title/heading of "Zone". Instead of counting over or using C4, can I have excel search for the term "Zone", regardless of column number, and excel will "know" that is the column I wish to work on?
I've never done it this way, or if it is possible.
Thanks for the help
 
Last edited:
OK..This is working nicely...Thank you
Instead of Copy the column, what if I wanted to cut and paste, instead of copy and paste?
I tried using Cut instead of Copy, and it faulted on me
Thanks

Code:
[Set Fnd = Range("4:4").Find("Document", , , xlWhole, , , False, , False)
If Not Fnd Is Nothing Then
    Intersect(Range("4:5000"), Fnd.EntireColumn).Cut
    Range("H4").Insert Shift:=xlToRight

This is working for me if I want to cut instead of copy

thanks
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,911
Messages
6,175,334
Members
452,636
Latest member
laura12345

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