Consulting

Results 1 to 3 of 3

Thread: Solved: Extend selection to next three cells

  1. #1
    VBAX Regular
    Joined
    Jun 2012
    Posts
    45
    Location

    Solved: Extend selection to next three cells

    I have selected the last cell in a column after A21 and I want to select next 3 cells in the selected ROW and clear the content from it.

    Thanks

    [VBA]ThisWorkbook.Sheets(1).Range("A21").End(xlDown).Select[/VBA]

  2. #2
    VBAX Regular
    Joined
    Jun 2012
    Posts
    45
    Location
    I made it, this is the correct code

    [VBA] ThisWorkbook.Sheets(1).Range("A21").End(xlDown).Select
    Selection.Resize(Selection.Rows.Count, Selection.Columns.Count + 3).ClearContents[/VBA]

  3. #3
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,645
    or
    [VBA]
    ThisWorkbook.Sheets(1).Range("A21").End(xlDown).resize(,3).clearcontents
    [/VBA]

Posting Permissions

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