Learning VBA, so most of what I am doing currently is fairly basic. I am trying to write some code that will paste something from one cell into another cell in a particular column. The row however will depend on the customer that has been selected.
For example, we have updated a sales total for customer A in cell K4 on Sheet1. I want to paste this into cell AV5 on Sheet2 as customer A is in row 5. If I then update the sales total for Customer C (also in cell K4 on Sheet1), I would need to paste into cell AV7.
I have a look up table which tells me which row each customer is in, and I have put this info into cell P3 on my original spreadsheet. I had hoped there was a way that I could specify the row number based on the number in cell P3 on Sheet1, but I seem to be running into errors with whatever I try. The rest of the code works if I specify the actual cell number, but not if I try and create a cell reference based on an entry into P.
Any help would be gratefully received!
For example, we have updated a sales total for customer A in cell K4 on Sheet1. I want to paste this into cell AV5 on Sheet2 as customer A is in row 5. If I then update the sales total for Customer C (also in cell K4 on Sheet1), I would need to paste into cell AV7.
I have a look up table which tells me which row each customer is in, and I have put this info into cell P3 on my original spreadsheet. I had hoped there was a way that I could specify the row number based on the number in cell P3 on Sheet1, but I seem to be running into errors with whatever I try. The rest of the code works if I specify the actual cell number, but not if I try and create a cell reference based on an entry into P.
Any help would be gratefully received!