+ Reply to Thread
Results 1 to 6 of 6

How to write values found via function into cell?

  1. #1
    Registered User
    Join Date
    08-30-2013
    Location
    Moscow, Russia
    MS-Off Ver
    Excel 2007
    Posts
    4

    How to write values found via function into cell?

    Hi all, I have a VBA function that pops up a folder dialog where the user selects a folder. Now I need that folder name (full path) to be written into a certain cell, but the code I've created for that doesn't work. Hope someone could help me out!

    Below are the function and the code. The code is supposed to pop up the browse dialog only if the existing cell value doesn't return a correct folder.

    Please Login or Register  to view this content.



    Please Login or Register  to view this content.
    Last edited by IOwnAKangaroo; 11-07-2013 at 08:58 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,052

    Re: How to write values found via function into cell?

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    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



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to write values found via function into cell?

    your code doesn't assign a value to V. change .Show to
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: How to write values found via function into cell?

    You function never creates a value for V. So BrowseFolder always returns a null
    Gary's Student

  5. #5
    Registered User
    Join Date
    08-30-2013
    Location
    Moscow, Russia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to write values found via function into cell?

    Quote Originally Posted by JosephP View Post
    your code doesn't assign a value to V. change .Show to
    Please Login or Register  to view this content.
    Thanks! And thanks to Jakobshavn, too!

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to write values found via function into cell?

    you're welcome :-)

    please don't forget to mark the thread solved (click the 'thread tools' link at the top, then 'mark solved')

+ 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: 6
    Last Post: 04-25-2013, 02:06 PM
  2. [SOLVED] RE-write if function with isna function for more values
    By funtastic in forum Excel General
    Replies: 6
    Last Post: 07-12-2012, 04:33 AM
  3. Replies: 4
    Last Post: 06-28-2012, 07:08 AM
  4. selection.find - write a number in the cell next to found cell
    By Sir_Nemo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2012, 07:29 PM
  5. search a cell for values in a range, return values found
    By carpe.cervisiam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2011, 12:52 PM

Tags for this Thread

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