+ Reply to Thread
Results 1 to 7 of 7

VBA copy and paste value

  1. #1
    Registered User
    Join Date
    06-02-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    6

    VBA copy and paste value

    I wish to copy the value from column A to column B with the condition only value from column A is copy to column B, value of column A is removed without removed or changing in any formula in column A. Currently i only achieved to copy from column A to column B but value at column A still remain. how do i should coding in VBA

    How to coding the undo at user form??

    anybody can help me..


    i uploaded a file for ur concern
    Attached Files Attached Files
    Last edited by mulanfox; 06-03-2010 at 12:13 AM. Reason: upload file

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: VBA copy and paste value

    Hello mulanfox, welcome to the forum.

    To copy and paste only values elsewhere, you use PasteSpecial. For example:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-02-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA copy and paste value

    Quote Originally Posted by Paul View Post
    Hello mulanfox, welcome to the forum.

    To copy and paste only values elsewhere, you use PasteSpecial. For example:
    Please Login or Register  to view this content.
    but how do i clear the data without remove its formula??

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: VBA copy and paste value

    What do you mean clear the data? A formula is a formula. If it results in something, it shows it to you.

    You can show nothing in a formula by setting it to "" in an IF statement, for example..

    =IF(A1*B1>10,"Yes","")

    But I'm not aware of a way to do what you're asking if I'm understanding you correctly. Maybe explain it better, or provide a sample workbook explaining it.

  5. #5
    Registered User
    Join Date
    06-02-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA copy and paste value

    Quote Originally Posted by Paul View Post
    What do you mean clear the data? A formula is a formula. If it results in something, it shows it to you.

    You can show nothing in a formula by setting it to "" in an IF statement, for example..

    =IF(A1*B1>10,"Yes","")

    But I'm not aware of a way to do what you're asking if I'm understanding you correctly. Maybe explain it better, or provide a sample workbook explaining it.
    actually is like that.. the value at column A is from sheet2 which i perform all the calculation. the value later by link to sheet1 column A. when a new calculation at sheet2 is done it automatically link to sheet1 column A. but i wan clear the value without clear the link when i use macro to remove to next column

  6. #6
    Registered User
    Join Date
    06-02-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA copy and paste value

    Quote Originally Posted by mulanfox View Post
    actually is like that.. the value at column A is from sheet2 which i perform all the calculation. the value later by link to sheet1 column A. when a new calculation at sheet2 is done it automatically link to sheet1 column A. but i wan clear the value without clear the link when i use macro to remove to next column
    file has been uploaded...

  7. #7
    Registered User
    Join Date
    06-02-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: VBA copy and paste value

    online i found before example but it not work..somebody please help me
    Sub Clear_Range()
    Dim myRg As Range
    Dim vRg As Range

    Set myRg = Range("A4:GZ67")

    On Error Resume Next
    Set vRg = myRg.SpecialCells(xlCellTypeConstants, 23)
    If Err = 0 Then
    vRg.ClearContents
    End
    Else
    Set myRg = Nothing
    Set vRg = Nothing
    MsgBox "No values, or values already cleared!"
    End If

+ 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