Thread: Formatting help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keri keri is offline
external usenet poster
 
Posts: 74
Default Formatting help

Charles,

Thanks for the answer. This is so close but I guess the problem I'm
having with the code is from something I did not explain to you so i'll
try and clarify what is on my sheet in the first place.

Tha data is on one sheet in up to 26 "tables" (I use tables as the best
way to describe it but it is actually just a range of cells surrounded
by a border). There is normally some rows of text in between each of
these groups of data, and the groups are arranged down the sheet. Each
group has it's own column headers as described above.

When I tested your code the first 2 sets of data did not have the extra
column with the P in it so it did nothing with these 2 groups. The
third group did have the extra column. The code did exactly what it was
supposed to in this group (eg moved the P into the first column and
then deleted the "P" column). However it also deleted all of the cells
below this group in this column.

So where the fourth group of data columns started as
No Time KPH
they ended up as
No KPH

Where the 5th group of columns started as
No P Time KPH
They ended up as
No Time KPH
(but obviously the code hadn't moved the P into the first column in
this case)

I think the code needs to recognise each group of data seperately, then
test if there is a P in column 2, then if there is to move the P to
column 1 and delete the cells in column 2 in that group only!


I hope all of that makes some sense to you. Perhaps the ranges could be
selected with activerange? Your code is much more sophisticated than I
expected - i was going to have the code select the first "table" and
ask the user if the second column was a P column, then act depending on
the answer!

Thanks again for your help.