Delete Cells on value

M

Michael Dobony

I need a macro to delete a group of cells (with a range name) in a column.
I checked the internet, but all I get is macros to delete entire columns or
rows. I need to not just delete the values, but move the neighboring cells
over. Can anybody help me with this?

Excel 2010
 
G

GS

I need a macro to delete a group of cells (with a range name) in a
column. I checked the internet, but all I get is macros to delete
entire columns or rows. I need to not just delete the values, but
move the neighboring cells over. Can anybody help me with this?

Excel 2010

When you select cells to delete you can right-click the selection and
choose 'Delete...' from the popup menu. A dialog will display where you
can specify how you want the adjacent cells to shift (left or up). It
also gives you the option to delete entire columns or rows.

If you need a macro to replace this built-in function then turn on the
Macro Recorder and go through the process manually, stop the recorder,
see what code was generated for your actions.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
M

Michael Dobony

When you select cells to delete you can right-click the selection and
choose 'Delete...' from the popup menu. A dialog will display where you
can specify how you want the adjacent cells to shift (left or up). It
also gives you the option to delete entire columns or rows.

If you need a macro to replace this built-in function then turn on the
Macro Recorder and go through the process manually, stop the recorder,
see what code was generated for your actions.

Like the other, this is for a non-Excel savy user who needs all this
automated for her.
 
G

GS

Like the other, this is for a non-Excel savy user who needs all this
automated for her.

Well.., people who use Excel regularly for work should, IMO, learn as
much about using their 'work tools' as possible. On the other hand, if
you need task-oriented solutions to be used by 'Excel dummies' then I
recommend using addins and workbook templates that use custom
toolbars/menus to get things done in a no-nonsense manner!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
M

Michael Dobony

Well.., people who use Excel regularly for work should, IMO, learn as
much about using their 'work tools' as possible. On the other hand, if
you need task-oriented solutions to be used by 'Excel dummies' then I
recommend using addins and workbook templates that use custom
toolbars/menus to get things done in a no-nonsense manner!

People are wasting 10-15 minutes on a repetative project several times a
day, causing a lot of overtime, with something that a simple macro should
be able to do for them. I am attempting to rebuild what someone else did in
a macro that everybody hates because it requires major revisions when the
layout of the pulled data changes. I'm attempting a quick workaround until
I can fix and recreate a macro that adapts to changes in pulled data.
 
R

Ron Rosenfeld

I need a macro to delete a group of cells (with a range name) in a column.
I checked the internet, but all I get is macros to delete entire columns or
rows. I need to not just delete the values, but move the neighboring cells
over. Can anybody help me with this?

Excel 2010

Yes, someone can help you.
Describe your problem in sufficient detail to allow someone to provide you a macro.

In general, to delete a named range, you would use the Delete method of the Range object.
You can specify one of two directions to shift cells to replace the deleted cells, or let Excel try to figure it out.

e.g: Range("Your_Named_Range").Delete Shift:=xlShiftUp

You can also "clear" a range using the Clear or ClearContents method of the Range object.
 
G

GS

People are wasting 10-15 minutes on a repetative project several
times a
day, causing a lot of overtime, with something that a simple macro
should
be able to do for them. I am attempting to rebuild what someone else
did in
a macro that everybody hates because it requires major revisions when
the
layout of the pulled data changes. I'm attempting a quick workaround
until
I can fix and recreate a macro that adapts to changes in pulled data.

I understand! That's the 'nature-of-the-beast', though, in my
experience. What I find helps is to persist a structure to the source
data so code works regardless of the content. That can often be
difficult when you're not in control of how the data is structured.
It's easier if you deal with data fields, harder when dealing with
custom reports!

Best wishes in your endeavors! Let us know if we can be of help...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 

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