gilligan73
New Member
- Joined
- Jul 16, 2014
- Messages
- 8
Hi experts. I thought I had it all worked out by creating a dynamic range using OFFSET and COUNTA, and it worked perefctly. But, the macro that uses these dynamic named ranges has several steps which causes a run-time error. I believe that this is due to the reference to the columns being deleted in the first step.
Say I have columns 1 - 10. All rows contain data, numbers or text. I then delete, say columns 2, 4, 6 and 8. I then add in some columns, to get information from a vlookup, for example. But columns 2 and 4 are in my dynamic named range AFTER I have deleted and added columns...So my dynamic ranges, which were correct, now have #REF in the formula. Not good. I have a bit of sorry workaround but was thinking to create dynamic named ranges that I need in VBA after I have deleted and added the rows. If this sounds reasonable, any good links to how to best to this? Other ideas?
Thanks in advance!
Say I have columns 1 - 10. All rows contain data, numbers or text. I then delete, say columns 2, 4, 6 and 8. I then add in some columns, to get information from a vlookup, for example. But columns 2 and 4 are in my dynamic named range AFTER I have deleted and added columns...So my dynamic ranges, which were correct, now have #REF in the formula. Not good. I have a bit of sorry workaround but was thinking to create dynamic named ranges that I need in VBA after I have deleted and added the rows. If this sounds reasonable, any good links to how to best to this? Other ideas?
Thanks in advance!