+ Reply to Thread
Results 1 to 6 of 6

Change value of cell on copy

Hybrid View

  1. #1
    Registered User
    Join Date
    02-16-2006
    Posts
    39

    Change value of cell on copy

    I have attached an Excel file.

    In this file, the user fills out a column of data and the cell in the first row of the given column is populated with the data entered in the column (see cell C1 for an example).

    Since the cell in the first row is a URL, all spaces must be entered as "%20" to ensure that the URL is valid. Is there any way to create a script such that the user could enter regular spaces when they are entering their data but the link in the first row would translate those spaces to "%20" when copied?
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Change value of cell on copy

    How about

    StringName=Replace(StringName, " ","%20")
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    02-16-2006
    Posts
    39

    Re: Change value of cell on copy

    Is that code that is intended to be inserted into a macro and run before every time a link is copied?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Change value of cell on copy

    Yeah - the StringName represents the URL - just put it through that before finalizing the link

  5. #5
    Registered User
    Join Date
    02-16-2006
    Posts
    39

    Re: Change value of cell on copy

    Thanks for the help.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Change value of cell on copy

    You're welcome and thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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: 8
    Last Post: 12-05-2021, 03:25 PM
  2. VBA script to copy cell on change
    By libussa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2014, 11:54 AM
  3. If a cell change value, copy & paste cell
    By Smally in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2014, 09:13 PM
  4. Replies: 7
    Last Post: 08-09-2013, 09:08 PM
  5. How to copy from cell above if no change in amount
    By LordOslek in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-17-2013, 07:33 AM
  6. [SOLVED] Copy paste on cell Change
    By jake.masters in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2012, 02:30 PM
  7. Excel 2007 : copy formula and cell reference does not change
    By MaryKMathias in forum Excel General
    Replies: 2
    Last Post: 12-20-2011, 03:45 AM

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