+ Reply to Thread
Results 1 to 9 of 9

help with function

  1. #1
    Registered User
    Join Date
    01-29-2016
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    3

    help with function

    Can you please help me with this error?

    Sub Column()
    Dim StartDate As Date, PeriodStartDate As Date, StartColumn As Integer, Data As Integer
    PeriodStartDate = Range("c2").Value
    StartDate = InputBox("Enter stating date", "Start Date")
    StartColumn = WorksheetFunction.Match(StartDate, Range("C7:AD7"), 0)
    End Sub

    shows the Error: unable to get the match property of the worksheetfunction class

    C2: starting date
    In the range C7 to D7 i have the following
    C7: =c2 (start date of the period)
    D7 to AD7: =previous column +1 (to advance day by day)

    C7:AD7 have the format to show only the day: 1, 2, 3,...

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: help with function

    Oops! cant see straight, ignore this reply.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: help with function

    Am no VBA expert but a guy here says that means match not found and suggests using a different function

    https://stackoverflow.com/questions/...rty-of-the-wor

  4. #4
    Registered User
    Join Date
    06-02-2018
    Location
    Italy
    MS-Off Ver
    2013-2019
    Posts
    31

    Re: help with function

    Attach a sample file for test.

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: help with function

    How exactly have you the cells formatted to show 1,2,3 etc

  6. #6
    Registered User
    Join Date
    01-29-2016
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    3

    Re: help with function

    Attachment 648440
    This is part of a code to select the starting column based on the date and color the period from start to end

  7. #7
    Registered User
    Join Date
    01-29-2016
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    3

    Re: help with function

    the format is: custom: d

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: help with function

    Inavlid attachment

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,851

    Re: help with function

    @Raven75


    Welcome to our forum. Please take a few minutes to read our forum rules and then adjust your thread as follows. You have violated three of our Forum Rules in just one post. Please fix all of them as you agreed to abide by our rules when you joined.

    Cross-posting Without Telling Us

    Your post does not comply with our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read https://www.excelguru.ca/content.php?184 to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    No further help to be offered, please, until the OP has complied with this request.


    Welcome to our forum. Please take a few minutes to read our forum rules and then adjust your thread as follows.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Last edited by alansidman; 11-06-2019 at 11:26 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 07-07-2018, 04:13 AM
  2. COUNTUNIQUE Function in Google Sheets; Excel lacks a direct counterpart to this function?
    By PivotTablePSHomage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2018, 05:27 AM
  3. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  4. Replies: 1
    Last Post: 06-10-2015, 12:56 PM
  5. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  6. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  7. Replies: 2
    Last Post: 03-20-2009, 01:29 PM

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