VBA code, insert code end of column
Results 1 to 2 of 2

Thread: VBA code, insert code end of column
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jul 2019
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA code, insert code end of column

    HTML Code:
    <a href="http://tinypic.com?ref=ega2xg" target="_blank"><img src="http://i64.tinypic.com/ega2xg.png" border="0" alt="Image and video hosting by TinyPic"></a>
    Code:
    Sub CopyToAnotherSheet2()'copy and transpose
    Dim NextRow As Long
    Dim cpRng As Range
    
    
    Application.CutCopyMode = False
    Application.ScreenUpdating = False
    
    
        Set cpRng = ActiveSheet.Range("c31:ab31")
        NextRow = Sheets("weekly").Cells(Rows.Count, 1).End(xlUp).Row + 1
        Sheets("Summary").Range("p4:p29").Copy
            Sheets("weekly").Cells(NextRow, 1).PasteSpecial Paste:=xlPasteValues, Transpose:=True
    
    
    Application.CutCopyMode = True
    Application.ScreenUpdating = True
    End Sub
    Above is the code. How do I get the code to run in column C (and below the previous week data) instead of at the very bottom?

  2. #2
    Board Regular
    Join Date
    Oct 2015
    Location
    South Wales
    Posts
    549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA code, insert code end of column

    Try changing the following lines as shown:
    Code:
        NextRow = Sheets("weekly").Cells(Rows.Count - 1, 3).End(xlDown).Row + 1
        Sheets("Summary").Range("p4:p29").Copy
            Sheets("weekly").Cells(NextRow, 3).PasteSpecial Paste:=xlPasteValues, Transpose:=True

Some videos you may like

User Tag List

Tags for this Thread

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
  •