Trying to enter the world of VBA and hitting one wall after another... Please Help

Copper Contributor

In my workbook I have a sheet named "New items for Sellerchamp uploa".

Within that sheet is column G with the header titled "Gender"

If that column has empty rows i want a Macro that will look at the sheet named "VbaRefDoc" at the named range GenderRef (This is also the header name)

Search each value top to bottom in sequence within the corresponding row Named range "ProductName" on sheet "New items for Sellerchamp uploa"

If it finds a match fill Column G with the value of Named Range "GenderVal" and move to the next empty row in column G. (It should stop at the first match and move on)

I want it to run 1 loop

 

I have tried dozens of assorted codes generated by "AI" to no avail. I understand garbage in garbage out but This is new to me. Most have run and completed with no error or result of any kind, others have given all kinds of errors. 

 

I actually need to do this for a bunch of columns but once i figure out 1 I Should be able to modify that code to work for my other needs.

 

Any help, or suggestions on resources that dont leave this old man feeling like a 10 year tossed into college would be greatly appreciated.

 

3 Replies
so to clarify I want it to reference the list and search the product names first for boy, and output 1-Male if it is in the title and move on or search for Girl, then, Junior, Women, Men, Unisex etc in that specific order.

I want to use a reference list rather than putting the search values into the code so that I can easily redo the order or add/delete from them if need be.

The ultimate goal is to pre-do some of my classifications for me when i import the data

I would recommend Absolute cell referencing to fix. The default would be Relative Reference. But if you want to lock the reference column and row so it does what you want it to do, which is "move on" or "search". Name referencing would fix the issue of range of cells in multiple Workbooks. For example, =D2*J$1 press F4 in invoke absolute referencing, if you press F4, the action will give you the option of Mixed Referencing. But if you want to lock two references then you would want to lock those with Absolute Referencing. I hope this information points you in the right direction. @Modnar1@Modnar1 

I will try to google what you have said tomorrow when I am less sleepy, and see if I can make any sense of it but as of right now your speaking a language I do not speak.