Advice how i would tackle this using an excel formula or vba solution

VBA learner ITG

Active Member
Joined
Apr 18, 2017
Messages
267
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi all,

I have over 500 spreadsheets which isnt formatted in the same way, I need to only capture the below column headers and associated data which can be in a row or column.

URN
Packaging
Delivery
Price

I need to capture the data in the below format to build a database:
UrnDUN00266
Packaging35.00
DeliveryTBC
Price87.00

<tbody>
</tbody>




Example of how the data is formatted in various spreadsheets looks like the below:

Campaign6PM CHRISTMAS OPENING TIMES STICKER
Campaign VersionVersion1
PO Number
Start Date09/11/2016
Created Byzack carter
ElementAll
StoreAll
StatusAll
PrinterAll
This Exported03-11-2016 11:23
Element CodeElement DescriptionElement TypeURNHeightWidthMaterialFinishingCols FrontCols BackColour DetailsDSSameDSDiffArtwork InstructionsKeyword1Keyword2Keyword3Keyword4Keyword5Print ProcessNumStoresBriefDetailsRuleAllocate QtyLibrary Qty% of LibraryTotal QtyPrice
DUN51136Christmas- CHRISTMAS- 6PMSticker (36mm x 22mm)DUN002663622Permanent Self-AdhesiveTTS40 FalseFalse Cheapest155 3103110.00 %341£52.00
Packing£35.00
DeliveryTBC
TOTAL£87.00

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col span="5"><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>

****** id="cke_pastebin" style="position: absolute; top: 190.4px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
DUN00266

<tbody>
</tbody>
</body>
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi ,

Not sure if this can be done with a formula or not !

If you want to do it in VBA then you can think of finding a specific word from a sheet and then capture one cell right of it and below which you have to do for all the criterias and then you can filter the extracted tabular section on each sheet to remove unnecessary combinations.

quick code sample would be something like this ,

Code:
Sub extract()


    Dim rng As Range
    Dim cell As Range
    Dim extractword As String


    Set rng = Range("A1:AZ100")


    extractword = "Delivery"


    For Each cell In rng.Cells
        If Not cell.Find(extractword) Is Nothing Then
            Range("BB1").Value = cell.Offset(1, 0).Value
            Range("BB2").Value = cell.Offset(0, 1).Value
        End If
    Next cell


End Sub
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,460
Members
448,965
Latest member
grijken

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