With the help of the online community, I've been piecing together solutions to a moderately complex solution. I'm hoping this post can tie them all together.
This first function identifies the name of a supplier based on its URL and creates a unique 3-character code based on a lookup table. This one function applies to any URL.
A2 = www. walmart.com/ip/33857317
B2 = WAL
The next set of functions properly identifies the item number (a specific section of a website's URL). Note however that each website has its own unique syntax; therefore, for this function to dynamically work, it must reference an array that tells it which appropriate function to use to yield the desired result (based on supplier URL).
A2 = www. walmart.com/ip/33857317
The arrays are found on the REFERENCE tab. The arrays are named ranges:
SUPP_PREFIX
SUPP_ITEM
A challenge I see is that in the SUPP_ITEM array, cell references are hard-coded into the listed functions (which worked when I used them individually because when I would pull the functions down, the cell references would auto-update). In this case however, how can instances of cell reference "A1" be made to vary or apply to the line in which it is being executed upon?
Tying the two main functions to generate a SKU dynamically based on a given supplier URL is the end goal.
Examples:
SUPP URL
www .walmart.com/ip/33857317
www. samsclub.com/sams/118235.ip
www. costco.com/Aquaterra-Spas-Ventura-96-jet%2c-6-person-Spa.product.100355896.html
DESIRED OUTCOME
WAL-33857317
SAM-118235
COS-100355896
A sample workbook is attached.
Thanks for your input!
Bookmarks