+ Reply to Thread
Results 1 to 3 of 3

VBA to post columns into first blank cell in row

  1. #1
    Registered User
    Join Date
    07-25-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    12

    VBA to post columns into first blank cell in row

    Hello,

    I want to copy and paste a range, G1:H250, into another sheet.

    I want it to be pasted into the first blank cell in row 6. How can this be done?

    I also want to keep the rows the same like G1 going into A1 and so on, not having G1 pasted to G6

  2. #2
    Registered User
    Join Date
    07-04-2019
    Location
    Sweden
    MS-Off Ver
    365
    Posts
    8

    Re: VBA to post columns into first blank cell in row

    Try something like this...
    lastRow = Sheets("Sheet5").Range("A" & Rows.count).End(xlUp).Row
    Sheets("Sheet4").Range("A3:C3").Copy Destination:=Sheets("Sheet5").Range("A" & lastRow)

  3. #3
    Registered User
    Join Date
    07-25-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    12

    Re: VBA to post columns into first blank cell in row

    Hi,

    Sub PasteR2()
    '
    ' PasteR2 Macro
    Dim x As Worksheet
    Dim y As Workbook

    Set x = Worksheets("Form 1")
    Set y = Workbooks.Open("Form.xlsx")

    x.Range("G:H").Copy

    y.Sheets("Sheet1").Cells(6, Columns.Count).End(xlToLeft).Offset(0, 2).PasteSpecial

    Where would it go in this vba? Thanks


    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Dragging formula to add two columns, but need to show blank when other cell is blank
    By doesntexist in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-05-2018, 11:18 PM
  2. [SOLVED] Hiding columns if cell is blank
    By lorber123 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-12-2015, 08:12 AM
  3. Replies: 3
    Last Post: 05-14-2015, 04:20 AM
  4. [SOLVED] VBA code to columns that have a blank cell in a range
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2014, 02:19 PM
  5. [SOLVED] Macro to specify blank cell/columns?
    By nawGo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-28-2014, 11:45 AM
  6. Compare two columns and delete cell in one column if cell next to it is blank
    By jacobhandson in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-17-2011, 01:51 PM
  7. Hiding columns if blank cell
    By Johnmus in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-23-2011, 08:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1