Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good afternoon,
Could somebody show me a simple macro please for how to delete entries in cells. I have text in cells B4-AA20 that I wanted to be able to delete by a macro. Thanks LD |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you have already selected the range, then
Selection.ClearContents or Range("B4:AA20").ClearContents You can find a lot of macro commands by just recording a macro via Tools, Macros, Record (pre 2007 command) Robert Flanagan http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "LiAD" wrote in message ... Good afternoon, Could somebody show me a simple macro please for how to delete entries in cells. I have text in cells B4-AA20 that I wanted to be able to delete by a macro. Thanks LD |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
At it's simplest this will do it Range("B4:AA20").ClearContents Be aware that this deletes everything in that range, if that's not what you want then post back. Mike "LiAD" wrote: Good afternoon, Could somebody show me a simple macro please for how to delete entries in cells. I have text in cells B4-AA20 that I wanted to be able to delete by a macro. Thanks LD |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Lovely,
I'd forgotten the simple way to record macros rather than writing code. Thanks for the reminder. "Mike H" wrote: Hi, At it's simplest this will do it Range("B4:AA20").ClearContents Be aware that this deletes everything in that range, if that's not what you want then post back. Mike "LiAD" wrote: Good afternoon, Could somebody show me a simple macro please for how to delete entries in cells. I have text in cells B4-AA20 that I wanted to be able to delete by a macro. Thanks LD |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are welcome! Thanks for the feedback!
Stefi €˛LiAD€¯ ezt Ć*rta: Lovely, I'd forgotten the simple way to record macros rather than writing code. Thanks for the reminder. "Mike H" wrote: Hi, At it's simplest this will do it Range("B4:AA20").ClearContents Be aware that this deletes everything in that range, if that's not what you want then post back. Mike "LiAD" wrote: Good afternoon, Could somebody show me a simple macro please for how to delete entries in cells. I have text in cells B4-AA20 that I wanted to be able to delete by a macro. Thanks LD |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you select range B4:AA20 and press Delete while recording a macro then
you get this sub: Sub Macro1() Range("B4:AA20").Select Selection.ClearContents End Sub You can then edit it this way if you prefer compact code: Sub Macro1() Range("B4:AA20").ClearContents End Sub Regards, Stefi €˛LiAD€¯ ezt Ć*rta: Good afternoon, Could somebody show me a simple macro please for how to delete entries in cells. I have text in cells B4-AA20 that I wanted to be able to delete by a macro. Thanks LD |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Simple For-Loop gives 1004 error using variable to EntireRow.Delete | Excel Programming | |||
vba - need simple function to delete ranges | Excel Programming |