Consulting

Results 1 to 4 of 4

Thread: Add to Column Next to Selection

  1. #1
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location

    Add to Column Next to Selection

    I have a script that copies the selected cells and pastes them into another workbook.

    What I need to do is after the paste is done I would like to add "Submitted" into the next column of the selected rows.

    So if selected cells are (A2:H30) after paste is completed I would like (I2:I30) to get "Submitted"

    Can this be done?

  2. #2
    Hi

    See if this helps.

    Assuming you start with A1:H30 selected:

    Dim r As Range
    
    Set r = Selection
    
    ' do the copy paste or whatever you need
    '...
    
    ' write "Submitted" to the right of r
    r.Offset(, r.Columns.Count).Resize(, 1).Value = "Submitted"

  3. #3
    VBAX Expert
    Joined
    Apr 2007
    Location
    Orlando, FL
    Posts
    751
    Location
    That worked, Thanks Lecxe.

  4. #4
    You're welcome. Thanks for the feedback.

Posting Permissions

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