+ Reply to Thread
Results 1 to 13 of 13

Help neede "Array" formula VBA

  1. #1
    Registered User
    Join Date
    09-29-2010
    Location
    Koudekerk a/d Rijn, Netherlands
    MS-Off Ver
    Office 2010
    Posts
    20

    Help neede "Array" formula VBA

    Hi,

    I'm trying to make a userform to display data from a worksheet previously entered.

    I need two keys for finding the right data, "Datum" and "Winkel".

    I have this code that almost works, but my problem is that I have to make de Array formula dynamic filled with values from ComboBox1 and ComboBox2 and
    I really don't know how to do that.

    here is the code that has to be changed:

    Please Login or Register  to view this content.
    B7 has to be the value from ComboBox1
    A9 has to be the value from ComboBox2

    Here is the complete code:
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help neede "Array" formula VBA

    Perhaps something like this:
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-29-2010
    Location
    Koudekerk a/d Rijn, Netherlands
    MS-Off Ver
    Office 2010
    Posts
    20

    Re: Help neede "Array" formula VBA

    Hi Norie,

    thanks for your quick reply, but unfortunately your code does not work?

    Any other suggestions?
    I'm just learning

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help neede "Array" formula VBA

    How does it not work?

    I can think of a few possible things that could go wrong but it would nice to know.

    My bet is on a type mismatch becasue the formula evaluated to an errror.

    Could you attach a sample workbook?

  5. #5
    Registered User
    Join Date
    09-29-2010
    Location
    Koudekerk a/d Rijn, Netherlands
    MS-Off Ver
    Office 2010
    Posts
    20

    Re: Help neede "Array" formula VBA

    Hi Norie,

    here is my file.
    It is Userform2

    What I am trying to build is a Userform for entering data wich is written on the worksheet DataInput.
    The userform has to check if a record for the specific "Datum" and "Winkel" already exists, if so it has to pul up the existing data into the form
    so it can be changed and re-written back to the worksheet.

    Hope this helps.

    Thanks again.
    Attached Files Attached Files

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help neede "Array" formula VBA

    You aren't using Evaluate in the code in that workbook.

    Anyway, can I clarify what you want to do?

    You want to look in B7:G7 for a date and in A9:A10 for a winkel (shop?).

  7. #7
    Registered User
    Join Date
    09-29-2010
    Location
    Koudekerk a/d Rijn, Netherlands
    MS-Off Ver
    Office 2010
    Posts
    20

    Re: Help neede "Array" formula VBA

    Hi Norie,

    sorry if I'm not making myself clear enough.

    The code "Evaluate" is used in userform2 (a form for testing purpose)

    All data is beeing written to the worksheet "DataInput"
    Here I want to look in Column A for a Date and in Column B for a winkel (= Shop )

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help neede "Array" formula VBA

    My apologies I was looking at the first worksheet and userform1, which I couldn't even get to open.

    This can probably be done with a formula but it might be better to use VBA.

    Would that be an option?

  9. #9
    Registered User
    Join Date
    09-29-2010
    Location
    Koudekerk a/d Rijn, Netherlands
    MS-Off Ver
    Office 2010
    Posts
    20

    Re: Help neede "Array" formula VBA

    That would be nice.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help neede "Array" formula VBA

    What values go in what textboxes?

  11. #11
    Registered User
    Join Date
    09-29-2010
    Location
    Koudekerk a/d Rijn, Netherlands
    MS-Off Ver
    Office 2010
    Posts
    20

    Re: Help neede "Array" formula VBA

    Whatever suits you well ?

    I did:

    DTPicker = datum
    Combobox1 = RangeName = Winkels
    TextBox1 = Omzet
    TextBox2 = Klanten
    TextBox3 = Uren

    TextBox4 = Jaar = Calculated Field from DTPicker = (Year)
    TextBox5 = Week = Calculated Field from DTPicker = (WeekNumber)
    TextBox6 = Day = Calculated Field from DTPicker = (Day - short)

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Help neede "Array" formula VBA

    Aren't some of those textboxes on Userform1?

    I came up with this for Userform2:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    09-29-2010
    Location
    Koudekerk a/d Rijn, Netherlands
    MS-Off Ver
    Office 2010
    Posts
    20

    Re: Help neede "Array" formula VBA

    Hi Norie,

    works like a charme!!!!!!!!!
    Thanks.

    This worksheet is for testing purpose only.
    Eventually I want 1 userform that does it all (Add - Search - Change - Delete) , so I have a long way to go.
    Especially this is my first try with VBA.

    Gr,
    Erik

+ Reply to Thread

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