I have tested for both text e.g "a" and numbers with the same results.
In the grand scheme of things i have a workbook containing raw data, i
would like to update this raw data using a button, the people im
completing this task for would prefer to done this way rather than
having cell references (links) that may become broken. This is where
they have had problems before.
The majority of raw data (80% ) comes from the same location, the other
20% comes from various different locations. Column B contains unique
codes that make it easy to find the 80% of data from one source, for
the remaining 20% i would like to be able to say if the code is "A"
look in this location, if its "B" then look here and so on.
The plan i put together to complete this task looks something like the
following.
select cell B2 and save as variable rng
Find the value of cellB2 and put it in variable sCode
start a loop
providing sCode doesn't equal "a" or "b" or "c" etc then
Use the code to point at souce that contains 80% of data and use the
find function ive created to return relevant data.
If sCode does equal "a" 0r "b" or "c" etc then
use a Case statement to select correct source of data
Case A : file A, sheet 1 Range D4:J4
Case B : file B, sheet 2 range H3:N3
etc
end select
copy selection
reopen original worksheet
paste special in rng
Set rng = rng.Offset(1, 0)
Loop Until rng = ""
I appreciate that this might not be how you would complete the task but
im not the most gifted of programmers with most of my experience coming
from coding Access applications. would welcome any ideas or suggestions
you have tho.