+ Reply to Thread
Results 1 to 5 of 5

Paste Value Macro

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    24

    Paste Value Macro

    I need to be able to have this macro running on a worksheet automatically. It would be to allow pasting text only into ALL cells on the worksheet.

    How would I do this?
    Please Login or Register  to view this content.
    Note: I recorded this macro however, I need to change the columns realistically to say columns A through P and always be active on the spreadsheet.

    I attempted to place it on the worksheet as
    Please Login or Register  to view this content.
    No luck could someone clean this up for me? thanks...

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,935

    Re: Paste Value Macro

    You have a sub within a sub...
    Please Login or Register  to view this content.
    Tfherefore, delete the red lines. Note: I don't see where you have copied anything to paste.
    Last edited by protonLeah; 06-10-2014 at 11:43 PM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    06-04-2014
    Posts
    24

    Re: Paste Value Macro

    Thanks, and I understand that as, I was looking for a method to apply this statement
    Please Login or Register  to view this content.
    To the entire sheet.. it was relatively late last night and was in a hurry...

    So to clarify, I have two questions:
    1) After recording any macro, how and where relative to the type of macro e.g. worksheet or workbook, how do you get the "modules" to run automatically in either the workbook or worksheet?
    2) I recorded the above macro, and would like to know how I can apply that small line of the code to the worksheet to allow pasting only the "text" or "values" only
    Please Login or Register  to view this content.
    or preferably:
    Please Login or Register  to view this content.
    Applying either one of these rules to the entire workbook would work as well

    Maybe what I am looking for Is VBA that would limit the number of characters and type of (values only) to any given cell in a column.

    Something like Msgbox "You are only allowed to copy/paste or enter no more than 5 characters to this cell" of course that would be the VBAlert

    Sorry for the confusion

    Quote Originally Posted by protonLeah View Post
    You have a sub within a sub...
    Please Login or Register  to view this content.
    Tfherefore, delete the red lines. Note: I don't see where you have copied anything to paste.
    Last edited by ragrone; 06-11-2014 at 05:31 AM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,935

    Re: Paste Value Macro

    You cannot write code to stand guard over copy/paste operations. You would have to use "complicated" Menu/ribbon modifiers: like http://www.ozgrid.com/forum/showthread.php?t=164806
    and
    http://www.rondebruin.nl/ribbon.htm

  5. #5
    Registered User
    Join Date
    06-04-2014
    Posts
    24

    Re: Paste Value Macro

    Actually I found this which works really well it forces the users to manually enter data into the worksheet....

    Please Login or Register  to view this content.
    However, I found a better solution to my Data Validation problem

    Please Login or Register  to view this content.
    That does a bang-up job and works well in conjunction with the excels built in Data Validation Dialogue box...

    Thanks... it was a long road to get back into the VBA groove... the last I coded anything was 2005...

    Quote Originally Posted by ragrone View Post
    Thanks, and I understand that as, I was looking for a method to apply this statement
    Please Login or Register  to view this content.
    To the entire sheet.. it was relatively late last night and was in a hurry...

    So to clarify, I have two questions:
    1) After recording any macro, how and where relative to the type of macro e.g. worksheet or workbook, how do you get the "modules" to run automatically in either the workbook or worksheet?
    2) I recorded the above macro, and would like to know how I can apply that small line of the code to the worksheet to allow pasting only the "text" or "values" only
    Please Login or Register  to view this content.
    or preferably:
    Please Login or Register  to view this content.
    Applying either one of these rules to the entire workbook would work as well

    Maybe what I am looking for Is VBA that would limit the number of characters and type of (values only) to any given cell in a column.

    Something like Msgbox "You are only allowed to copy/paste or enter no more than 5 characters to this cell" of course that would be the VBAlert

    Sorry for the confusion

+ 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] Simple copy and paste macro- Paste special help needed.
    By hernancrespo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 07:02 AM
  2. RECORDED MACRO PASTE'S DATE DIFFERENTLY TO MANUAL PASTE
    By Pauldecan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  3. [SOLVED] Copy and Paste macro needs to paste to a changing cell reference
    By loulou in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2005, 07:06 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