May 31 2020 02:39 AM
Hello All,
I am very new to vba code. I am learning mainly by adapting existing macros.
On the screenshot here, you can see a line of code that isn't working.
This code, as a whole, creates a new sheet for each row of data.
I want to create a sparkline in cell A20. The problem is how to sourcedata range. It is always columns BK to CW, but I need to tell it how to use just one row.
The &Rng.Row operation works on all other lines, but not here.
Can anyone help?
Thanks,
Nick
May 31 2020 02:57 AM - edited May 31 2020 02:59 AM
Solution
Hi,
Currently you are supplying a row reference to only the CW column of MasterSheet!BK:CW, but the BK column also requires a row reference:
"MasterSheet!BK" & Rng.Row & ":CW" & Rng.Row
Regards
May 31 2020 03:16 AM
In minutes, you've fixed what I've spent many hours trying to sort.
I'm so grateful!
Many thanks,
Nick :)
May 31 2020 03:22 AM
You're very welcome! You're doing the right thing by trying to adapt code yourself in order to develop your understanding of VBA. Best way to learn, in my opinion.
Regards
May 31 2020 02:57 AM - edited May 31 2020 02:59 AM
Solution
Hi,
Currently you are supplying a row reference to only the CW column of MasterSheet!BK:CW, but the BK column also requires a row reference:
"MasterSheet!BK" & Rng.Row & ":CW" & Rng.Row
Regards