Results 1 to 11 of 11

Time Saving Techniques?

Threaded View

  1. #1
    Registered User
    Join Date
    04-20-2007
    Posts
    8

    Time Saving Techniques?

    I wonder if anyone can help me, I think part of the solution involves using active cell.

    I import lots of data into a spreadsheet then have to manually format it which takes hours, I want code to automate it.

    Example: I have data such as:

    No-----Name-----Date---Price----Cost
    10-----Dino------etc-----1--------2
    10-----Dino------etc-----3-------5
    12-----Bino------etc-----4--------6
    13-----Rino------etc------5-------5
    13-----Rino-----etc-------6--------6


    I want it looking like this:

    No-----Name-----Date---Price----Cost
    10-----Dino------etc-----1--------2
    10-----Dino------etc-----3-------5
    shaded cells to here ishh 4-------7

    No-----Name-----Date---Price----Cost
    12-----Bino------etc-----4--------6
    shaded cells to here ishh 4---------6

    No-----Name-----Date---Price----Cost
    13-----Rino------etc------5-------5
    13-----Rino-----etc-------6--------6
    shaded cells to here ishh 11-------11

    The difficulty is due to the fact that the number in No column varies, for example there may be 2 rows of 10 or 4 rows of 10. What is the quickest way to format it all too, so have a border and font size etc all the same?

    At present I have to manually insert blank rows between the different numbers in the No column, copy column headings, then manually sum up Price and Cost, then insert borders. But for hundreds of records.

    Any ideas?

    I found this code to insert 3 blank rows manually for me when the numbers in No column are different:
    Sub Insert Rows
    
    myRow = 3
    
    Do Until Cells(myRow, 1) = ""
    
    If Cells(myRow, 1) <> Cells(myRow - 1,1) Then
    Rows(myRow).EntireRow.Insert
    Rows(myRow).EntireRow.Insert
    Rows(myRow).EntireRow.Insert
    myRow=myRow + 3
    End if
    myRow=myRow + 1
    
    Loop
    
    End Sub
    Thanks for any suggestions inc web sites or books, if this is possible in a macro or VBA.
    Last edited by mudraker; 04-20-2007 at 08:00 PM.

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