+ Reply to Thread
Results 1 to 3 of 3

VBA look for cell next to first blank, copy and paste

  1. #1
    Registered User
    Join Date
    10-24-2020
    Location
    London
    MS-Off Ver
    10
    Posts
    1

    Question VBA look for cell next to first blank, copy and paste

    Hi there,

    I need a vba code that looks in a particular sheet, in a particular column for the first unpopulated cell, then copies the value of the first cell on the right of the blank cell just found, and finally pastes the copied value to the first blank cell in another column in another worksheet.

    I have been trying for some time, but not luck, would appreciate you help. Thank you.

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA look for cell next to first blank, copy and paste

    Give this a try:

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: VBA look for cell next to first blank, copy and paste

    Quote Originally Posted by maniacb View Post
    Dim col1, col2, c, g As Range
    Dim lr1, lr2, u As Long
    Just pointing out that for the above declarations, only 'g' will be a Range variable and 'u' a Long variable... the rest will be declared as Variants. In VBA, you must declare each individual variable as to its data type otherwise it will default to being a Variant.

+ 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. Insert the Blank Cell and copy and paste value
    By chacha123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2015, 02:34 AM
  2. Copy and paste data from one tab into another tab into first blank cell
    By DJK001 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-08-2014, 09:54 PM
  3. vba to copy and insert row and copy/paste cell value if cell not blank!
    By GaryDML in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2014, 02:17 AM
  4. Copy and paste in first blank cell
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2013, 01:42 AM
  5. Copy and paste if cell value is not blank
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-14-2012, 07:09 AM
  6. vba for copy paste to blank cell
    By Lazypanda in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-20-2008, 09:38 AM
  7. Copy and paste formula only if the cell is non-blank
    By cabybake in forum Excel General
    Replies: 1
    Last Post: 02-07-2005, 04:06 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