Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Dec 2004
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Organise data (Excel 2002)

    Hi,
    Please guide me codes for organising data in attached format exel file.

    Thanks
    Gan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Organise data (Excel 2002)

    This looks very much like <post#=437230>post 437230</post#>. You should be able to adapt the code in <post#=437248>post 437248</post#> for this situation.

  3. #3
    Lounger
    Join Date
    Dec 2004
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Organise data (Excel 2002)

    Hi Hans,
    im able to perform sheet 2 column A using your codes previously.and hav did that.
    In addition, i would like to perform ways to paste sheet 2 column B in as shown in the attached exel.

    Actually im looking for solutions for the Date column part in sheet 2.
    NOTE: program will count sheet 1 the B column number of Off Hours. Eg: Count 3 for Off Hours then each Club ID will repeat 3 times and paste
    in sheet2 3 times for each club id. Program must know to exclude Normal Working Hours counting in column B.

    Thanks
    Gan

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Organise data (Excel 2002)

    Please study the following code carefully and try to understand how it works. It should help you to create your own variation next time. As you will see, the macro closely resembles the one from the other thread.

    Sub Transfer()
    Dim wsh1 As Worksheet
    Dim wsh2 As Worksheet

    Dim lngRowA As Long
    Dim lngRowB As Long

    Set wsh1 = Worksheets("Sheet1")
    Set wsh2 = Worksheets("Sheet2")

    lngRowA = 2
    Do
    lngRowB = 2
    Do
    If wsh1.Cells(lngRowB, 2) = "Off Hours" Then
    lngRowC = lngRowC + 1
    wsh2.Cells(lngRowC, 1) = wsh1.Cells(lngRowA, 1)
    wsh2.Cells(lngRowC, 2) = wsh1.Cells(lngRowB, 3)
    End If
    lngRowB = lngRowB + 1
    Loop Until wsh1.Cells(lngRowB, 2) = ""
    lngRowA = lngRowA + 1
    Loop Until wsh1.Cells(lngRowA, 1) = ""

    Set wsh2 = Nothing
    Set wsh1 = Nothing
    End Sub

  5. #5
    Lounger
    Join Date
    Dec 2004
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Organise data (Excel 2002)

    hi hans.
    really thanks..it works fine..
    really appreciate ur help on this.. as im not good at this..
    thaks alots for your time spending...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •