AndrewMB
Board Regular
- Joined
- Feb 3, 2008
- Messages
- 75
Guys,
I have a spreadsheet setup for someone at work. They used to have to enter all sorts of details everytime we shipped out a product. Now they just enter the cust. ord. no. and using vlookup the rest is filled in for them.
A new customer has come along and they don't use seperate order numbers per part, so booking out those parts doesn't suit the sheet. All other customers do so I don't want to change how the sheet works throughout.
What I wanted to do, was when it came to shipping out product on this new customer, was have a button at the side of the sheet which when pressed would find the active cell, and enter the new lookup formulas on this row only, working off the part number instead of the cust. ord. no.
This would allow the person to enter the part number and still have the details fill in automatically. But then on the next row, for our usual customers the sheet wouldnt have changed.
The row will be different each time, so i tried to get vba to add the below formula into column D at which ever row the active cell was.
Range("D" & activecell.row & ").Formula = "=IF($E & activecell.row=0," ",VLOOKUP($E & activecell.row,$AD$7:$AH$268,5,FALSE))"
I have a spreadsheet setup for someone at work. They used to have to enter all sorts of details everytime we shipped out a product. Now they just enter the cust. ord. no. and using vlookup the rest is filled in for them.
A new customer has come along and they don't use seperate order numbers per part, so booking out those parts doesn't suit the sheet. All other customers do so I don't want to change how the sheet works throughout.
What I wanted to do, was when it came to shipping out product on this new customer, was have a button at the side of the sheet which when pressed would find the active cell, and enter the new lookup formulas on this row only, working off the part number instead of the cust. ord. no.
This would allow the person to enter the part number and still have the details fill in automatically. But then on the next row, for our usual customers the sheet wouldnt have changed.
The row will be different each time, so i tried to get vba to add the below formula into column D at which ever row the active cell was.
Range("D" & activecell.row & ").Formula = "=IF($E & activecell.row=0," ",VLOOKUP($E & activecell.row,$AD$7:$AH$268,5,FALSE))"