Delete Worksheet and replace/delete links

S

Shaz

Morning all
Two columns of my worksheet are copied to a main sheet. If at some
later time I wish to delete the worksheet is there a way of creating a
macro that would do this and additionally present me with the option
of replacing the linked cells with values or simply delete the
columns?

TIA

Shaz
 
D

Dave Peterson

I'm not quite sure what you mean.

You could record one macro when you did a copy|paste special|paste links for one
option.

You could record another macro when you did a copy|paste special|Values for the
next.

Or you could record a macro that converts the already pasted links to values
(copy|paste special|values once more).

Give them each a nice name and run the one you need.

If you need help tweaking the code, post back.
 
S

Shaz

Hi Dave
Sorry for not being clear. The problem with this workbook is that
there are a number of sheets representing employees with two columns
representing their times and payments taken to a Summary sheet. These
are updated from another departmental workbook using worksheet tabs as
a reference(the columns are headed with the tab reference). When the
employee leaves I manually delete the sheet and take out the columns
from the summary sheet or if they leave for a different department I
remove the sheet but overwrite the columns with the values (Values
first copied to another temporary sheet then brought back). I thought
the solution would be to use the Find option but thats as far as I
got. How to delete and/or update columns by macro is the problem.
Often I can find part of the answer in this newsgroup and adapt the
macro accordingly. I will try what you have suggested - thanks again
for replying.

Shaz
 
D

Dave Peterson

A lot of times, recording the macro is a good place to start.

Along with getting the starting code, you can refine your thinking to do exactly
what you want when you're doing it manually.

I know that sometimes I'll be recording a macro and part way through, I'll
realize that I could have done something else. I close the workbook without
saving and start over.

If you keep your false starts down to a minimum, then the recorded macro is
usually easier to clean up.
 
Top