Find/move column by header

doriannjeshi

Active Member
Joined
Apr 5, 2015
Messages
326
Office Version
  1. 365
Platform
  1. Windows
Hi,
I need to find a column with header named "example" and move this column to a specified column nr
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
One more thing, can this be done to find the column closest to a1, as it is it starts from right to left and it's returning the wrong column since I have to columns named the same by default, I need the opposite.
 
Upvote 0
Code:
Columns(Rows(1).Find("example", Cells(1, 1)).Column).Cut
Did you check that all the cells that have "example" do not have leading or trailing characters (maybe spaces)?
 
Upvote 0

Forum statistics

Threads
1,224,272
Messages
6,177,631
Members
452,786
Latest member
k3calloway

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