+ Reply to Thread
Results 1 to 10 of 10

cleaner code

  1. #1
    Registered User
    Join Date
    11-12-2012
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    cleaner code

    I created this macro that copies from cell A1 and paste into the next cell I want to keep incrementing but I dont want to keep copy and paste the same thing how can I make it cleaner, with out having next_1, next _2 , next_3 and so on

    Please Login or Register  to view this content.
    I had it before every 10sec just for testing,
    Last edited by scancool; 11-13-2012 at 01:22 PM.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: cleaner code

    Not sure maybe this?

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: cleaner code

    In a standard module:

    Please Login or Register  to view this content.
    In ThisWorkbook:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    11-12-2012
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: cleaner code

    thanks mike, but that fills up from a4 to a8 with the same thing at once, the data from A1 change every min, thats why the timer check on A1 every min and copies in the next cell, this works I just want to make it cleaner so I can go up to 100

  5. #5
    Registered User
    Join Date
    11-12-2012
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: cleaner code

    THANK YOU SHG!!!!!!!!!!!! it works!!!!!!!!!!!!!!!!

  6. #6
    Registered User
    Join Date
    11-12-2012
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: cleaner code

    I feel kinda embarrassed to ask, but I been trying for a while to add the time stamp on the A column for every print with no luck, how can it be done ? I had put =now() on A3 cell and change Range("A3:D3") but it copies the now() so the time is the same for every row
    Please Login or Register  to view this content.

    Clipboard01.jpg
    Last edited by scancool; 11-13-2012 at 07:25 PM.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: cleaner code

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-12-2012
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: cleaner code

    Thank you SHG
    I keep trying after I posted yesterday, and came out with this code
    Please Login or Register  to view this content.
    but yours seems better

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: cleaner code

    If that takes care of your original query, please select Thread Tools from the menu above and mark the thread as solved. Thanks.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: cleaner code

    A little better:

    Please Login or Register  to view this content.

+ 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