deleting the contents of activecell, +2 cells next to it
deleting the contents of activecell, +2 cells next to it
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: deleting the contents of activecell, +2 cells next to it

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3

    Join Date
    Feb 2002
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Or simply :-

    ActiveCell.Resize(, 3).ClearContents

    (Note the "ClearContents" instead of "Clear")

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com