![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 18
|
I want to delete the contents of (eg) cell A2,B2,C2, how do I do this?
I thought it would be something like: ActiveCell.Delete ActiveCell.Offset(0, 1).Activate ActiveCell.Delete ActiveCell.Offset(0, 1).Activate ActiveCell.Delete But that doesn't work. Thanks for any help |
|
|
|
|
|
#2 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
You can try this:
Sub clear_out() Selection.Resize(Selection.Rows.Count, _ Selection.Columns.Count + 2).Clear End Sub This assumes that you want the active cell and the next two deleted. You could designate the 'active cell.' Cheers, Nate [ This Message was edited by: NateO on 2002-02-18 11:55 ] |
|
|
|
|
|
#3 |
|
Join Date: Feb 2002
Posts: 47
|
Or simply :-
ActiveCell.Resize(, 3).ClearContents (Note the "ClearContents" instead of "Clear") |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|