Finding value in a row

MRN227

New Member
Joined
Dec 18, 2018
Messages
15
My customer sends a report that is about 5000+ rows of data. This report consistently changes format. I need to extract data regardless of the position of where the data is in the row. For example:

I need to lookup the customer order number based on the criteria of the order number beginning with "D" in a row. See below:

Order begins with
Myformula
number_of_shipmentsload_idis_3pl_vrid_compliantadhoc_loadlate_adhoc_5hrlate_adhoc_4hrcanceled_loadfulfillment_shipment_idshipper_idwarehouse_iddestinationwarehouse_typelanestop_numberis_amzlhad_rejected_loadcarriercarrier_zoneship_methodlate_slamshipped_1hr_lateshipped_on_time_1hrship_daytime_pstship_day_pstship_weekship_monthoriginal_cpt_pstoriginal_cpt_utccpt_at_slam_pstcpt_at_slam_utccpt_utcmanifest_run_pstasn_datetime_pstexsd_pstexsd_utcfc_slam_pstfc_slam_utcscheduled_arrival_utcactual_arrival_utcon_time_arrivalloading_start_utcloading_complete_utcon_time_loadedscheduled_departure_utcactual_departure_utcon_time_shipped_load_1hrroot_cause_1hrroot_subcause_1hrfc_carrier_1hrprior_daycpt_at_slam_datetime_azcpt_at_slam_time_azship_datetime_azship_time_azship_shiftexpected_ship_shift
D
Hlookup?1
114SZPVP71Scheduled00FALSEDfL4rHJKnTBA002810918000XUSPHCH13PLXUSP->HCH1110XPOLHCH1AMZL_US_SH0104/3/2019 16:034/3/20192019-142019-44/3/2019 11:004/3/2019 18:004/3/2019 15:004/3/2019 22:004/3/2019 22:004/3/2019 15:584/3/2019 16:034/3/2019 11:004/3/2019 18:004/3/2019 8:074/3/2019 15:074/3/2019 22:004/3/2019 22:520 4/3/2019 22:5804/3/2019 22:004/3/2019 23:001LATE_DEPARTURELATE_MANIFESTFCFALSE4/3/2019 15:008:004/3/2019 16:0316:00SHIFT_2SHIFT_1

<colgroup><col style="mso-width-source:userset;mso-width-alt:3730;width:77pt" width="102"> <col style="mso-width-source:userset;mso-width-alt:2962;width:61pt" width="81"> <col style="mso-width-source:userset;mso-width-alt:7936;width:163pt" width="217"> <col style="mso-width-source:userset;mso-width-alt:4937;width:101pt" width="135"> <col style="mso-width-source:userset;mso-width-alt:1572;width:32pt" width="43"> <col style="mso-width-source:userset;mso-width-alt:1462; width:30pt" width="40" span="2"> <col style="mso-width-source:userset;mso-width-alt:2998;width:62pt" width="82"> <col style="mso-width-source:userset;mso-width-alt:3437;width:71pt" width="94"> <col style="mso-width-source:userset;mso-width-alt:5412;width:111pt" width="148"> <col style="mso-width-source:userset;mso-width-alt:4242;width:87pt" width="116"> <col style="mso-width-source:userset;mso-width-alt:3401;width:70pt" width="93"> <col style="mso-width-source:userset;mso-width-alt:2742;width:56pt" width="75"> <col style="mso-width-source:userset;mso-width-alt:3949;width:81pt" width="108"> <col style="mso-width-source:userset;mso-width-alt:4973;width:102pt" width="136"> <col style="mso-width-source:userset;mso-width-alt:3218;width:66pt" width="88"> <col style="mso-width-source:userset;mso-width-alt:1901;width:39pt" width="52"> <col style="mso-width-source:userset;mso-width-alt:4352;width:89pt" width="119"> <col style="mso-width-source:userset;mso-width-alt:1718;width:35pt" width="47"> <col style="mso-width-source:userset;mso-width-alt:4790;width:98pt" width="131"> <col style="mso-width-source:userset;mso-width-alt:5485;width:113pt" width="150"> <col style="mso-width-source:userset;mso-width-alt:2340;width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:4096;width:84pt" width="112"> <col style="mso-width-source:userset;mso-width-alt:5083;width:104pt" width="139"> <col style="mso-width-source:userset;mso-width-alt:4169;width:86pt" width="114"> <col style="mso-width-source:userset;mso-width-alt:3218;width:66pt" width="88"> <col style="mso-width-source:userset;mso-width-alt:2596;width:53pt" width="71"> <col style="mso-width-source:userset;mso-width-alt:2889;width:59pt" width="79"> <col style="mso-width-source:userset;mso-width-alt:3876; width:80pt" width="106" span="2"> <col style="mso-width-source:userset;mso-width-alt:3913; width:80pt" width="107" span="2"> <col style="mso-width-source:userset;mso-width-alt:3657;width:75pt" width="100"> <col style="mso-width-source:userset;mso-width-alt:4169;width:86pt" width="114"> <col style="mso-width-source:userset;mso-width-alt:4205;width:86pt" width="115"> <col style="mso-width-source:userset;mso-width-alt:3657; width:75pt" width="100" span="4"> <col style="mso-width-source:userset;mso-width-alt:5193;width:107pt" width="142"> <col style="mso-width-source:userset;mso-width-alt:4242;width:87pt" width="116"> <col style="mso-width-source:userset;mso-width-alt:3693;width:76pt" width="101"> <col style="mso-width-source:userset;mso-width-alt:4169;width:86pt" width="114"> <col style="mso-width-source:userset;mso-width-alt:5193;width:107pt" width="142"> <col style="mso-width-source:userset;mso-width-alt:3766;width:77pt" width="103"> <col style="mso-width-source:userset;mso-width-alt:6034;width:124pt" width="165"> <col style="mso-width-source:userset;mso-width-alt:5046;width:104pt" width="138"> <col style="mso-width-source:userset;mso-width-alt:6326;width:130pt" width="173"> <col style="mso-width-source:userset;mso-width-alt:4498;width:92pt" width="123"> <col style="mso-width-source:userset;mso-width-alt:5229;width:107pt" width="143"> <col style="mso-width-source:userset;mso-width-alt:3547;width:73pt" width="97"> <col style="mso-width-source:userset;mso-width-alt:2377;width:49pt" width="65"> <col style="mso-width-source:userset;mso-width-alt:5961;width:122pt" width="163"> <col style="mso-width-source:userset;mso-width-alt:4937;width:101pt" width="135"> <col style="mso-width-source:userset;mso-width-alt:4169;width:86pt" width="114"> <col style="mso-width-source:userset;mso-width-alt:3145;width:65pt" width="86"> <col style="mso-width-source:userset;mso-width-alt:2413;width:50pt" width="66"> <col style="mso-width-source:userset;mso-width-alt:4754;width:98pt" width="130"> </colgroup><tbody>
</tbody>

Please help. I'm racking my brain trying to get this figured out. My plan is, to produce the value (order#) then use vlookup based on that value... I hope I'm making sense.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Re: Need help finding value in a row

Thank you Brombrough! One quick, dumb, question. Within the macro, would you happen to know where I define the header? Im fairly new to VBA.
 
Upvote 0
Re: Need help finding value in a row

Hi MRN227,

The headers are predefined before macro runs.

Sheet1 is the format of the sheet that comes from the customer.

Sheet2 is the same headers but in the order you want to see them.

Rules.

1) Make sure that column "A" is the same on both sheets
2) Make sure same headers are on both sheets
3) Best before running macro you should delete clear all cells in range "B2:{Last Cell in data} on sheet2. (Just keep headers and Column "A")

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,216,011
Messages
6,128,265
Members
449,436
Latest member
blaineSpartan

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