We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide
VBA Code
DoubleEntry
Posts: 81 Forumite
in Techie Stuff
Hi All
Can anyone help with an excel VBA problem i have?
In column A I have a list of names. I have named A1 as range and use this to open another file, do some copying and pasting and then close. Now I need to loop down col A to do the same for A2 and so on, but hit a wall when the code goes back to the range for opening the next file, as it is still showing the name connected to A1.
Is there some way of naming the entire col A as the range but going through them one by one?
Any help is much appreciated.
Thanks
Can anyone help with an excel VBA problem i have?
In column A I have a list of names. I have named A1 as range and use this to open another file, do some copying and pasting and then close. Now I need to loop down col A to do the same for A2 and so on, but hit a wall when the code goes back to the range for opening the next file, as it is still showing the name connected to A1.
Is there some way of naming the entire col A as the range but going through them one by one?
Any help is much appreciated.
Thanks
0
Comments
-
Not vba, but think this could be got working using something like EZmacros0
-
I haven't used VBA for ages, but rather than specify named ranges, why not refer to the cells by row & column ordinates? Then you can use a variable for the row number and a for loop to iterate through each one.
If you do a quick web search, there are examples of small functions you could write to identify the last populated row/column in a worksheet, which could be used as the upper bound in the for loop, if necessary.0 -
Thanks for the replies - I have found a solution which is similar to esuhl's suggestion.
Cheers0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 354K Banking & Borrowing
- 254.3K Reduce Debt & Boost Income
- 455.3K Spending & Discounts
- 247K Work, Benefits & Business
- 603.7K Mortgages, Homes & Bills
- 178.3K Life & Family
- 261.2K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.7K Read-Only Boards