+ Reply to Thread
Results 1 to 5 of 5

Need VBA macro to copy cell contents instead of its formatting

  1. #1
    Registered User
    Join Date
    12-31-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Need VBA macro to copy cell contents instead of its formatting

    Dear All,

    I'm in need of a VBA macro which copies a particular cell value to clipboard without copying its other cell formats like cell color, border etc.,

    Below is my problem in detail.

    Daily at my work, I use an application in which i need to copy a cell value(Say: 123456), but it wont accept the value if i just copy entire cell and paste. To copy that cell value(123456) into that application, I have to select that cell where i have that value(123456) -> press F2( or copy the cell value(123456) from formula bar) -> double click on the value(123456) to select and copy entire value(123456) in that cell.

    I tried below macro but it is not meeting my requirement, as it is copying entire cell instead of just cell value.


    Please Login or Register  to view this content.

    Any help will be grateful.
    Last edited by Nanimadhu; 01-11-2014 at 06:03 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Need VBA macro to copy cell contents instead of its formatting

    Hi, Nanimadhu,

    please wrap your code with tags as requested by Forum Rule#3.

    Maybe something like this:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    12-31-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Need VBA macro to copy cell contents instead of its formatting

    Hi HaHoBe,

    Thanks for your suggestion.

    I edited the post accordingly. And the code which you provided is showing some error message(I've attached the screenshot of it).

    Could you please help.

    error msg.jpg

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Need VBA macro to copy cell contents instead of its formatting

    Hi, Nanimadhu,

    my bad - I thought I had set a hint about that into the code. You will need to set a Reference in the VBE to Microsoft Forms 2.0 Object Library in order to get the code working.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    12-31-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Need VBA macro to copy cell contents instead of its formatting

    Thank you.

    Its working fine now.

+ 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. Copy cell contents and all formatting
    By smithbruce in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-24-2008, 02:54 AM
  2. Copy cell contents and formatting
    By garyk007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-22-2007, 12:14 AM
  3. Macro to Copy Contents of Cell Right 1 Down 1
    By oldgit99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2007, 09:41 AM
  4. [SOLVED] Macro - copy cell contents IF
    By Scott Wagner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-17-2006, 05:55 PM
  5. Macro to move cell contents based on formatting
    By Scott Wagner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2005, 11:25 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