Consulting

Results 1 to 3 of 3

Thread: Help w/Offset Paste

  1. #1
    VBAX Newbie
    Joined
    Jan 2018
    Posts
    1
    Location

    Help w/Offset Paste

    Hi, pretty sure I'm over looking the obvious. Just need to have the copied range paste in the first empty cell to the right of D19.
    Sub AddColumn()
        Application.ScreenUpdating = False
        Sheets("Output").Select
        Dim Count As Integer
        Count = 0
    
        If Range("D19").Offset(0, Count) = "" Then
            Sheets("Temp").Range("E14:E26").Copy
            Sheets("Output").Range("D19").Offset(0, Count).PasteSpecial (xlPasteValues)    
            Count = Count + 1
        End If
    
    
        Application.ScreenUpdating = True
    End Sub
    Last edited by SamT; 01-10-2018 at 08:02 AM. Reason: Added Code Formatting Tags with Editor's # Icon

  2. #2
    VBAX Expert
    Joined
    May 2016
    Posts
    604
    Location
    You forgot to put a loop in!!

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Sub AddColumn() 
        Application.ScreenUpdating = False 
    
    Sheets("Temp").Range("E14:E26").Copy 
            Sheets("Output").Range("D19").End(xlToRight).Offset(0, 1).PasteSpecial (xlPasteValues) 
     
        Application.ScreenUpdating = True 
    End Sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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