Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Ramdom Excel Data 2

Status
Not open for further replies.

Finedean

MIS
May 4, 2006
80
0
0
US
Hi Everyone,
Does anyone know a program to help me export data from excel to Microsoft Access?
The data in excel is not in row/Column format.

Thanks in advance
dean
 
skip,
I think I know why it's pulling the 0.
In the excel sheet there is more than one computed fee cell.
one in F40 and it equal 0 and the other one is the one I need to pull wich is F57 and it equal 2710.06
I think this is why we're getting the 0.
 




Please send me the COMPLETE data for this example.

I need to know EXACTLY what COLUMN each of the VALUES is in.

Is there ambiguity in the Row Title/Value? I need to see the data in order to understand.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 



try this...
Code:
Sub Main()
'loads a new sheet with a table of values for
'PlanID, Participant count & Computed asset balance
    Dim lRow As Long, wsSource As Worksheet, wsTable As Worksheet, lRowOut As Long, a
    Set wsSource = ActiveSheet
    Set wsTable = Worksheets.Add
    With wsTable
        .Cells(1, 1).Value = "PlanID"
        .Cells(1, 2).Value = "Participant count"
        .Cells(1, 3).Value = "Computed asset balance"
        .Cells(1, 4).Value = "Computed fee"
    End With
    With wsSource
        lRowOut = 2
        For lRow = 1 To LastCell(wsSource).Row
            Select Case Trim(Left(.Cells(lRow, 1).Value, 8))
                Case "Plan ID:"
                    a = Split(.Cells(lRow, 1).Value, " ")
                    wsTable.Cells(lRowOut, 1).Value = a(2)
                Case "Particip"
                    wsTable.Cells(lRowOut, 2).Value = .Cells(lRow, "G").Value
                Case "Computed"
                    Select Case Trim(.Cells(lRow, 1).Value)
                        Case "Computed asset balance:"
                            wsTable.Cells(lRowOut, 3).Value = .Cells(lRow, "F").Value
                        Case "Computed fee:"
                            If .Cells(lRow, "F").Value > 0 Then
                                wsTable.Cells(lRowOut, 4).Value = .Cells(lRow, "F").Value
                                lRowOut = lRowOut + 1
                            End If
                    End Select
            End Select
        Next
    End With
End Sub

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top