Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-30-2019, 10:30 PM
Tphil413 Tphil413 is offline Macro to find a header based on a value in another cell Windows 10 Macro to find a header based on a value in another cell Office 2016
Novice
Macro to find a header based on a value in another cell
 
Join Date: May 2019
Posts: 18
Tphil413 is on a distinguished road
Default Macro to find a header based on a value in another cell

I'm looking for some help writing a vba macro to find header with a name that is equal to another cell, then copy the entire column to a new column to the right. The value I want to find will be in the header row in cells (F2-Q2) and the value I am looking for can be found in cell V1. Once the header is found, copy the entire column and paste in column AG.



I've attached an example worksheet. I appreciate any help you can provide!
Attached Files
File Type: xlsx Example A.xlsx (14.3 KB, 5 views)
Reply With Quote
  #2  
Old 07-01-2019, 03:31 AM
p45cal's Avatar
p45cal p45cal is offline Macro to find a header based on a value in another cell Windows 10 Macro to find a header based on a value in another cell Office 2016
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Code:
Sub blah()
Columns(Application.Match(Range("V1").Value2, Rows(2), 0)).Copy Columns("AG")
End Sub
Reply With Quote
  #3  
Old 07-23-2019, 09:59 AM
Tphil413 Tphil413 is offline Macro to find a header based on a value in another cell Windows 10 Macro to find a header based on a value in another cell Office 2016
Novice
Macro to find a header based on a value in another cell
 
Join Date: May 2019
Posts: 18
Tphil413 is on a distinguished road
Default

Worked perfectly, thanks!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to select cell based on formula mreynolds1775 Excel Programming 4 09-22-2017 12:13 PM
Macro- find and replace from preselected options based on frequency (like an Ad libs) blondie Word VBA 0 02-27-2017 01:41 PM
Can anyone here tweek this macro for renaming Excel files based on a cell's contents? chrisd2000 Excel Programming 6 07-01-2014 01:53 PM
Macro to find a header based on a value in another cell Word VBA Macro to Find and Replace based on the Alt Text of an Image bennymc Word VBA 1 01-27-2014 04:23 PM
Macro based on cell value ubns Excel Programming 1 05-07-2012 04:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft