+ Reply to Thread
Results 1 to 2 of 2

Unable to use variable as "Field:" setting

  1. #1
    Registered User
    Join Date
    04-30-2010
    Location
    Texas, USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Unable to use variable as "Field:" setting

    Hi,

    I have searched high and low for this answer, and i am very sorry if it is located in another thread, but I was not able to find it. My problem is.....

    I have a form where I collect a filter and 2 columns. I then filter those 2 columns, take all the rows that match the filter, and copy them to another worksheet.

    This work as long as I have a filter on only 1 row, and i hard-code the column number. But, I really need to filter on 2 columns, and I need the user to be able to specify which to 2 columns.

    Here is the issue - I get an error whenever I try to use a variable for the column (field). I have tried using string and integer, but same error. Below is the code (look for ***** to see problem area), and thank you in advance for any assistance.



    Please Login or Register  to view this content.
    Last edited by CherryBoy; 04-30-2010 at 12:17 PM. Reason: Added code tags

  2. #2
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Unable to use variable as "Field:" setting

    Hi

    I think your problem is that you've declared txtField1 and txtField2 but you haven't assigned a value to them.

    You've got the line FieldNumber1 = txtField1 but you haven't assigned a value to txtField1.

    Dion

+ 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