+ Reply to Thread
Results 1 to 7 of 7

Copying into empty cells 2 - macro

  1. #1
    Registered User
    Join Date
    07-11-2013
    Location
    Bham, England
    MS-Off Ver
    Excel 2003
    Posts
    33

    Copying into empty cells 2 - macro

    Hi

    Really hope someone can help.
    I need to start from its most basic so i can see what the macro is doing & then adapt.

    See attachment.
    This will take the form of a button to be clicked on in sheet1.
    Sheet1 is my input sheet, sheet2 is my history sheet.
    I want to copy the cell range B4:F9 in sheet1 into sheet2 - starting from cell C3.

    Next time i click the button, copy the cell range B4:F9 sheet1 into sheet2 again, but underneath the data already there in sheet2

    Each time i click the button it just keeps adding the data in sheet1 into sheet2, to form a history.

    Thanks,
    Alex.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Copying into empty cells 2 - macro

    Here is the code. Add a button to your sheet and link this code to it.

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    07-11-2013
    Location
    Bham, England
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Copying into empty cells 2 - macro

    Thanks so much, Alan.

    All the best my friend.

  4. #4
    Registered User
    Join Date
    07-11-2013
    Location
    Bham, England
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Copying into empty cells 2 - macro

    Hi Alan

    A little problem if you can sort...

    The data copied into sheet2 always starts at cell C2. (wanted cell C3)
    I've tried changing the C3's in the code to C4 etc, but makes no difference.

    Thanks,
    Alex.

  5. #5
    Registered User
    Join Date
    07-11-2013
    Location
    Bham, England
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Copying into empty cells 2 - macro

    It appears to be ignoring the first 2 lines of code under - Application.ScreenUpdating = False - & just using lr=, in this case, to begin with, starts at C2.
    If i put + 1 at the very end of the lr= statement, it then starts at C3, yet adds a blank row between each set of data copied into sheet2, mmmm....

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Copying into empty cells 2 - macro

    Changed up the code a little bit. Not sure why it was ignoring that line. Try this:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-11-2013
    Location
    Bham, England
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Copying into empty cells 2 - macro

    Genius, Alan

    Thank you, i can now get cracking!

    Alex

+ 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. Copying into empty cells
    By butlerar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2014, 09:29 PM
  2. MACRO to empty a range of cells based on whether specified cell is empty
    By TBJV in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 10:35 PM
  3. Formula/Macro for copying, skip empty cells
    By joscar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-16-2011, 06:04 PM
  4. copying empty cells as empty
    By sjhonny in forum Excel General
    Replies: 2
    Last Post: 01-17-2007, 06:52 AM
  5. macro to colour empty cells (cells not recognized as empty)
    By Gerben in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2005, 11:05 AM

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