+ Reply to Thread
Results 1 to 5 of 5

Text Box Copy and Paste

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    Devon
    MS-Off Ver
    Excel 2010
    Posts
    3

    Text Box Copy and Paste

    Hi,

    As a long term reader of this site - I'm always amazed with the solutions offered here and so I lay a challenge down to you all..

    I have a template spreadsheet with text boxes referenced to cell contents (=$D$4 for instance), a macro then takes my template (approx 100 lines) and copies it out across different files and expands it to 3000+ lines in some cases. My problem is that the text boxes rely on absolute cell referencing to display anything but as the template is copied I need the reference to adjust as any formula would.

    Anyone any ideas?

    Unfortunately I cannot use a cell to display the information as the formatting will not allow the length of information to be displayed..

    Any help would really be appreciated.

    Thanks,

    Johndinho

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,912

    Re: Text Box Copy and Paste

    If you have some logic to how the text box and its referenced cell relate, then you could use code like this, which links the textbox to the cell just the the left.

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 10-07-2014 at 12:18 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    11-13-2012
    Location
    Devon
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Text Box Copy and Paste

    Thanks Bernie,

    The Text box covers the cell referenced and an unrelated cell to the right. Can I amend the code to "....column 0 &....."

    Thanks,

    John

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,912

    Re: Text Box Copy and Paste

    Sure - try changing to this, by removing the - 1

    ExecuteExcel4Macro "FORMULA(""=R" & sh.TopLeftCell.Row & "C" & sh.TopLeftCell.Column & """)"

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    Devon
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Text Box Copy and Paste

    Thanks Bernie,

    This is now working - Excellent help!!

+ 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. [SOLVED] VBA code to open many files, copy text, close file, paste text in second work
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 02-11-2014, 12:59 PM
  2. Replies: 13
    Last Post: 11-29-2012, 08:25 PM
  3. Copy and Paste Help If Not Certain Text
    By buddylee375 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2009, 12:20 AM
  4. Copy and Paste text from a cell to a text box
    By AnthonyJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2009, 04:18 AM
  5. Copy paste Text Box
    By jeff.p in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2007, 12:14 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