Results 1 to 6 of 6
  1. #1
    ivandgreat is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    4

    Excel VBA to Access VBA

    Hello,



    I have the excel vba in my data and i wanted to convert the vba code in access.

    below is my code that i'm working on from excel vba,

    idA = Application.Index(wsPT.Range("B2:B" & wsPT.Cells(Rows.Count, "B").End(xlUp).Row), 0, 1)
    idB = Application.Index(wsPT.Range("C2:C" & wsPT.Cells(Rows.Count, "C").End(xlUp).Row), 0, 1)


    For k = LBound(idA) To UBound(idA)
    For t = LBound(idB) To UBound(idB)
    If idA(k, 1) = idB(t, 1) Then
    .
    .

    End If
    Next
    Loop
    any one could help me on this.

    br,

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    This is like taking a story, written in Swahili, to a an Irish pub and saying "Could someone translate this into Gaelic for me?"

    While most people here have a passing knowledge of Excel, I suspect that very few have an extensive enough knowledge of Excel VBA to be able to directly 'translate' this to Access VBA for you. If you could give us an idea, in plain English (no Swahili, or Gaelic, for that matter!) of what you're trying to accomplish, we'd be happy to try and assist you!

    Linq ;0)>

  3. #3
    ivandgreat is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    4
    Quote Originally Posted by Missinglinq View Post
    This is like taking a story, written in Swahili, to a an Irish pub and saying "Could someone translate this into Gaelic for me?"

    While most people here have a passing knowledge of Excel, I suspect that very few have an extensive enough knowledge of Excel VBA to be able to directly 'translate' this to Access VBA for you. If you could give us an idea, in plain English (no Swahili, or Gaelic, for that matter!) of what you're trying to accomplish, we'd be happy to try and assist you!

    Linq ;0)>
    Actually, i have a table in access that i wanted to compute based on two fields and have it in different output. But i don't know how and where to start.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by ivandgreat View Post
    Actually, i have a table in access that i wanted to compute based on two fields and have it in different output. But i don't know how and where to start.
    Unless you can explain what you mean by "i wanted to compute based on two fields and have it in different output," nobody here is going to be able to help you.

    Linq ;0)>

  5. #5
    ivandgreat is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    4
    Quote Originally Posted by Missinglinq View Post
    Unless you can explain what you mean by "i wanted to compute based on two fields and have it in different output," nobody here is going to be able to help you.

    Linq ;0)>
    Hi, i just uploaded the sample files i have.

    I have 3 tables in it, i only want to compute an output based on table "Input", the output is in the table "Output".

    the logic is this,
    - in table "Input", i have two fields "NE" and "FE".
    - there is no duplicate ID @ field "NE"
    - @ field "NE" first lookup the records in field "FE", and record it, after search it will lookup the adjacent "NE" again and loop until nothing found. example. In item 1, 2100 will found one item in field "FE" which is in item 4, the adjacent "NE" is ID 2002, this ID will search the value @ field "FE" so it has two with "NE" 2001 and 2200, these two IDs will do the same until found nothing. All found ID will be recorded on different table which is called table "Ouput".
    - The table "Output" is only the result of the logic mentioned above.
    - Other field @ table "Output" is part of the loop that were computed like field "To2G Capacity" and "To3G Capacity" is only adding all field values @ "NE 2G" and "NE 3G" (@ table "Input") related to the IDs recorded @ table "Output" field "DepID_Current".

    Hope you could help me on this.

    br,
    ivan
    Attached Files Attached Files

  6. #6
    ivandgreat is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2013
    Posts
    4
    Hi,

    Good day! Could anyone help me on this. Thanks!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 12-28-2012, 02:06 PM
  2. Replies: 4
    Last Post: 12-17-2012, 01:21 PM
  3. Replies: 7
    Last Post: 05-09-2012, 06:06 AM
  4. import excel file to access 2003 yes, access 2007 no
    By stapik in forum Import/Export Data
    Replies: 9
    Last Post: 07-27-2011, 07:09 AM
  5. Replies: 1
    Last Post: 08-31-2009, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums