+ Reply to Thread
Results 1 to 4 of 4

Excel VBA Cell copy / paste Code request

  1. #1
    Registered User
    Join Date
    03-05-2009
    Location
    Vail, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    83

    Post Excel VBA Cell copy / paste Code request

    The following code starts in column B. It bolds the first value of a row and changes the font to a lighter shade/tint if it is repeated on the following row.

    Question: for the bold rows, the value in the 4th column needs to be copied on the same row in column 33.

    Efficiency counts. This report can have 35,000 rows.

    Please Login or Register  to view this content.
    This code is running from inside MS Access
    ObjXL is an object varable for Excel.Application

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Excel VBA Cell copy / paste Code request

    This should run much more efficiently. I couldn't test so there could be small errors, but it should be solid overall. Let me know if you need help with any errors you may encounter.

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    03-05-2009
    Location
    Vail, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    83

    Post Re: Excel VBA Cell copy / paste Code request

    This is great! Have an error and isolated it in debug mode (with objxl.visible = true)
    Found it, my apologies if you looked as I re-pasted:

    One more thing: I need to clear the value in column AD in the Else statement

    Please Login or Register  to view this content.
    Last edited by RxMiller; 08-17-2011 at 06:14 PM. Reason: found solution - this code works great!!

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Excel VBA Cell copy / paste Code request

    Use this line to clear the content in column AD:

    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)

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