+ Reply to Thread
Results 1 to 8 of 8

For every row, find the first blank cell and "paste" values from another sheet

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    Brasil
    MS-Off Ver
    2013
    Posts
    17

    For every row, find the first blank cell and "paste" values from another sheet

    People, I'm relative new to Excel VBA and I'm having a little bit trouble with the subject.

    I have 2 sheets and want to, when I click a button, copy some information from one sheet and paste on the other one.

    I don't know what i did wrong, since the program gives no error.

    The code I've written:
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: For every row, find the first blank cell and "paste" values from another sheet

    Can you attach your workbook please.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: For every row, find the first blank cell and "paste" values from another sheet

    can you attach a sample file for testing ?
    If solved remember to mark Thread as solved

  4. #4
    Registered User
    Join Date
    12-10-2013
    Location
    Brasil
    MS-Off Ver
    2013
    Posts
    17

    Re: For every row, find the first blank cell and "paste" values from another sheet

    Here's my workbook.
    Attached Files Attached Files

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: For every row, find the first blank cell and "paste" values from another sheet

    Okay - assuming what you are trying to do is find the next blank row in sheet "Banco de Dados" and paste in values from sheet "Controle", then use:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-10-2013
    Location
    Brasil
    MS-Off Ver
    2013
    Posts
    17

    Re: For every row, find the first blank cell and "paste" values from another sheet

    Thanks, dude! It worked great but now I have one question:

    I'm trying to understand what this "End(xlUp)" means. I saw it in a line somewhere and thought it can fit someway my code but I don't know the mean of it and how to implement it in another code.

    If you can explain it to me I'll be very glad!

    Anyway, thank you very much.

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: For every row, find the first blank cell and "paste" values from another sheet

    It's the equivalent of pressing Ctrl-Up. So the bit of code that says;
    Please Login or Register  to view this content.
    is the equivalent of going to the last row of column A, then pressing Ctrl-Up to move to the last cell with something in it.

    It's the quickest way of find the end of a used range, and working from the bottom up is more reliable than working from the top down, as that method will only find the last cell before an empty cell, which may not be the last actual used row of the column.

    Hope that clarifies!

  8. #8
    Registered User
    Join Date
    12-10-2013
    Location
    Brasil
    MS-Off Ver
    2013
    Posts
    17

    Re: For every row, find the first blank cell and "paste" values from another sheet

    Now I understand.
    Thanks a lot, man.

+ 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] Need to modify the Paste function of this VBA Macro from "Paste" to "Paste Special Values"
    By zicitron in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-04-2013, 03:44 AM
  2. Replies: 0
    Last Post: 02-28-2013, 05:00 PM
  3. Replies: 3
    Last Post: 02-16-2011, 02:55 PM
  4. Replies: 1
    Last Post: 01-30-2006, 06:10 PM
  5. Changing "returned" values from "0" to "blank"
    By LATATC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2005, 12:05 PM

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