How to handle shifted columns

T

Tornado

Hi,

I have a function StoreData in VB 6.0 class which takes Excel Range as
parameter. From the form I would call this function and pass the grouping
column and data column to read from this range. Let us say the Range is
having 5 columns i.e. B,C,D,E and F so i would call ReadData
RangeName,"C","E" where C is my grouping column and E is my data column.

I would also store this call in another sheet of the same workbook so that
when I switch off my computer and call another function RefreshData, it would
automatically call ReadData with same parameters to give me the same results
back. Now the problem is that user may insert some more columns in between C
and D columns or between B and C column and he can also increase the no. of
rows in the same range after I have written the call details to the another
sheet.

My problem is how to ensure that when I put on my computer and call the
RefreshData method it would still ensure that grouping column is picked as
"C" which may/may not have shifted to new position and to correctly pickup
data column as "E" which may/may not have shifted to new position. Idea is
that columns should be picked up correctly.

I know I would have to do some trick with Storing the details but I am not
aware how to handle this.

Would really appreciate your help.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top