Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

VBA question

  • 20-02-2011 4:03pm
    #1
    Registered Users, Registered Users 2 Posts: 98 ✭✭


    Hi Folks,

    Im pretty new to VBA with excel and was wondering if some one could point me in the right direction.

    I've got a workbook with 2 sheets, lets say A and B.

    B contains customer details
    A contains customer orders.

    I need to extract details from A based on each custome in B.

    Its pretty straight forward im just a bit stuck on how to do it in VBA.

    I think the code should look something like the following.

    Select into TableB all records in B,
    Select into TableA all records in A

    For each record in TableB loop,
    clear custdetails
    Select into custorders all records in A
    Where TableB-custID equals tableA->custID.
    perform action with custdetails
    end loop

    any help appreciated.

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,089 ✭✭✭henryporter


    I'm not quite following what you're trying to do here - you want to loop through table B to find corresponding records in table A and do what with the results?


  • Registered Users, Registered Users 2 Posts: 98 ✭✭gerryg80


    I'm not quite following what you're trying to do here - you want to loop through table B to find corresponding records in table A and do what with the results?

    Thanks for the reply

    with the results, i intend on creating a new spreadsheet and automatically email the results to the customer. (this bit i have sorted/working).


  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    use a database instead of excel:D


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    amen wrote: »
    use a database instead of excel:D

    +1

    Dunno why you are doing this in Excel.


  • Registered Users, Registered Users 2 Posts: 98 ✭✭gerryg80


    BostonB wrote: »
    +1

    Dunno why you are doing this in Excel.

    thanks for the advice, ill take it under consideration


  • Advertisement
  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    Maybe you've a reason that you've not mentioned here.


Advertisement