+ Reply to Thread
Results 1 to 3 of 3

transfer data to another sheet

  1. #1
    Forum Contributor
    Join Date
    04-14-2014
    Location
    Philippines
    MS-Off Ver
    2007, 2010, 2013, 2016.
    Posts
    169

    transfer data to another sheet

    Hi, I'm not familiar with vba, but I was able to use this example. Pls help me understand.
    in this example you have to created a button, once clicked all data in INPUT sheet will be transferred to DATA sheet. the space becomes blank and ready for another input.
    this goes well when all CELLS are filled with data, the column in another sheet continue to expands.
    my question are:
    but when the there are empty cells in the said range, at a point the column stop expanding and will recur on the same column continuously every time new data are entered.
    which line in vba should be change? Or if I want the transfer to automatically add zeros on empty space, what should be added to the line?
    thank you in advance for any help.

    Please Login or Register  to view this content.
    Last edited by getafixkwik; 05-12-2017 at 04:06 PM. Reason: Please use code tags!

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: help with vba

    This line:

    Please Login or Register  to view this content.
    finds the last column with data, and adds 1 to it, which determines where (which column) to paste data.
    The way it works is that it checks from the end, moving left, and stops when it finds data. However, the 6 in that line, refers to row 6, so if the last column with data is blank in row 6, then the code would paste the new data in the wrong column, because it did not find the real last column. If you have a row in that range that ALWAYS has data, then you could change the 6 to that row number, or you could check all rows (less efficient but sometimes necessary. For example, instead of lc =.. you could use
    Please Login or Register  to view this content.
    That would check all rows from 4 to 58, and use the last column of the longest row.
    Last edited by jeffreybrown; 05-12-2017 at 04:04 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    04-14-2014
    Location
    Philippines
    MS-Off Ver
    2007, 2010, 2013, 2016.
    Posts
    169

    Re: transfer data to another sheet

    thanks Arkadi for your guidance. it works! sorry guys for the blunder.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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