Hi All:
I'm trying to fill cell O7 with the data from a cell related to the cell I click on. The following code was kindly supplied by this board a couple of years ago and worked perfectly for the dashboard I was working on. Unfortunately I can't get it to work in this case.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target(1).Address <> "$d$22" Then Range("d22").Value = "" & Target(1).Formula
End Sub
Let me explain why & what I'm trying to do -
I have a table of about 450 cells that list the replenishment needs for a store. Each cell contains the needs of a specific item. For example, cell H13 lists the needs of Children's Tops - Size Small, Cell I13 lists the needs of Children's Tops - Size Medium, etc. The needs are displayed as the number of boxes needed; 1,2,3 etc.
What I'd like to do is click on a cell and have the bar code associated with that item appear in cell O7. This would allow the person filling the orders to scan the bar code and accurately capture the SKU rather than hand enter it, which has lead to incorrect SKU's.
I planned to do this by having another table (hidden) next to the table with the replenishment needs. That table would contain the SKU from which the bar code is based. So cell H13 (Children's Tops - Size Small,) will have the associated SKU in cell W13.
In the end, I want to click on H13 and have the info from W13 appear in O7. Or click I13 and have the info from X13 appear in O7, etc... (O7 will simply be set with a barcode font)
I think all I need to do is modify the above code to include an offset of 13 cells, but I can't get it to work.
All help is appreciated.
Thanks in advance.
I'm trying to fill cell O7 with the data from a cell related to the cell I click on. The following code was kindly supplied by this board a couple of years ago and worked perfectly for the dashboard I was working on. Unfortunately I can't get it to work in this case.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target(1).Address <> "$d$22" Then Range("d22").Value = "" & Target(1).Formula
End Sub
Let me explain why & what I'm trying to do -
I have a table of about 450 cells that list the replenishment needs for a store. Each cell contains the needs of a specific item. For example, cell H13 lists the needs of Children's Tops - Size Small, Cell I13 lists the needs of Children's Tops - Size Medium, etc. The needs are displayed as the number of boxes needed; 1,2,3 etc.
What I'd like to do is click on a cell and have the bar code associated with that item appear in cell O7. This would allow the person filling the orders to scan the bar code and accurately capture the SKU rather than hand enter it, which has lead to incorrect SKU's.
I planned to do this by having another table (hidden) next to the table with the replenishment needs. That table would contain the SKU from which the bar code is based. So cell H13 (Children's Tops - Size Small,) will have the associated SKU in cell W13.
In the end, I want to click on H13 and have the info from W13 appear in O7. Or click I13 and have the info from X13 appear in O7, etc... (O7 will simply be set with a barcode font)
I think all I need to do is modify the above code to include an offset of 13 cells, but I can't get it to work.
All help is appreciated.
Thanks in advance.