+ Reply to Thread
Results 1 to 10 of 10

not paste the formatting

  1. #1
    Registered User
    Join Date
    10-16-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel XP
    Posts
    9

    not paste the formatting

    I've looked and seen some ideas but I can not put the coding together myself because I only slightly understand what I'm doing with VBA. Basically I want this macro to only cut and paste the text without the formatting. The macro is supposed to cut from one worksheet and paste to another worksheet in the first available spot, however its taking the formatting with it.
    Please Login or Register  to view this content.
    Thanks in advanced, sorry for the simple question but I tried searching and have been unable to figure this out.
    Last edited by Leith Ross; 10-16-2009 at 05:56 PM. Reason: Added Code Tags

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    re: not paste the formatting

    Maybe like this:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    re: not paste the formatting

    If you leave out the destination then the cut is to the clipboard.
    set another object to point to the destination and use pastespecial to paste the info you want:

    eg:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-16-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel XP
    Posts
    9

    re: not paste the formatting

    Shg, Your code keeps the formatting but it strips away my combo box, I don't know how to make a code to add the combo box back

    Tony H, I'm not sure I understand where to insert that piece of code. I haven't been able to get that to work.

    I really appreciate it!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    re: not paste the formatting

    but it strips away my combo box,
    What combo box?

  6. #6
    Registered User
    Join Date
    10-16-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel XP
    Posts
    9

    Re: not paste the formatting

    Well I have a combo box in the cell that is being moved to the other worksheet. I need to leave the combo box behind and just transfer that cell values to the other sheet.

    I'll explain it again and try to be clearer. I have a sheet the columns are "Item, Date, Price, Status" Under the status column there is a combo box that has the options of choosing "Sold" or "Available" When the status is changed to Sold I want to move the contents of the cell to another worksheet, Lets name it "Customer Sold". The code I'm using right now moves the Cells over but it takes away the combo box and the color.

    I'm using the count if function to track the number of available items and the number of sold items, and the only way I can get the countif function to differentiate between Sold items and Available items is by moving the sold items to another sheet.

    Hopefully this makes sense. This is the last bit of info I need to have this sheet up and running. I really appreciate all input.

  7. #7
    Registered User
    Join Date
    10-16-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel XP
    Posts
    9

    Re: not paste the formatting

    Alright so I was able to do some searches and put together a code that will Copy and paste special and only paste the values. But it seems like you can only paste Special when you copy, So the macro doesn't move Sold items and just copies them into the other worksheet. Is there a code I could add that will clear the contents of the Cells that where copied.

    Please Login or Register  to view this content.

    End Sub

    Basically this works but i need the cells that where copied to be blank so it appears it has been Cut. But I still need to keep the combo box and the color so I can't just delete the Row. I hope this makes sense.
    Last edited by snooze24; 10-19-2009 at 03:59 PM.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: not paste the formatting

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.

    Thanks.

  9. #9
    Registered User
    Join Date
    10-16-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel XP
    Posts
    9

    Re: not paste the formatting

    sorry bout that.

  10. #10
    Registered User
    Join Date
    10-16-2009
    Location
    Chicago, IL
    MS-Off Ver
    Excel XP
    Posts
    9

    Re: not paste the formatting

    So I adjusted the code to clear the contents of Items listed as sold after it copies the info to the ShirinSold worksheet. But for some reason there is a whole new set of problems. Now if 2 items are sold it only pastes 1 item and it will over right anything that was in the 2nd row of ShirinSold and will not paste to the next available row. I really thought this was going to work but am out of luck

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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