Closed Thread
Results 1 to 3 of 3

shorten my code

  1. #1
    Registered User
    Join Date
    06-05-2008
    Posts
    12

    shorten my code

    I wanted to copy I,K,M,O,Q and S column in each row into another sheet.

    Initially, I have written the code to copy my data into another sheet as the following:

    xlsheet_l.cells(4,6) = xlsheet.cells(5,9)
    xlsheet_l.cells(4,7) = xlsheet.cells(5,11)
    xlsheet_.cells(4,8) = xlsheet.cells(5,13)
    xlsheet_.cells(4,9) = xlsheet.cells(5,15)
    xlsheet_l.cells(5,6) = xlsheet.cells(6,9)
    xlsheet_l.cells(5,7) = xlsheet.cells(6,11)
    xlsheet_.cells(5,8) = xlsheet.cells(6,13)
    xlsheet_.cells(5,9) = xlsheet.cells(6,15)

    However, I have over 500 rows to copy my data into another sheet. I want to shorten my code.Therefore, I have tried on the looping. Is there anyway that I can shorten my code?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please read the Forum Rules and then edit your post to wrap your code with Code Tags.
    Entia non sunt multiplicanda sine necessitate

  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
    OP unresponsive; thread closed.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Imported VBA code not working....
    By HuskerBronco in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-02-2008, 05:57 PM
  2. Code Execution Degrades Over Time
    By KDT in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-25-2008, 04:28 PM
  3. Running code while displaying a UserForm with vbModeless
    By PilgrimTim in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-06-2007, 08:08 AM
  4. Problems understanding automated emailing code.
    By DDONNI in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-19-2007, 12:26 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