+ Reply to Thread
Results 1 to 3 of 3

VB Paste.Speacial.values

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    VB Paste.Speacial.values

    Good morning,
    Seems that when you work with complex things you forget about the small things...

    I need help with the following:
    I have this code to add a formula if a column is triggered

    If TCol = 8 Then
        Cells(Target.Row, "J").FormulaR1C1 = "=IF(RC8="""","""",RC8+40)"
    End If
    I also need this function to grab what is in that cell (J) and do a paste special.values to Cell(I).
    I could do this but I’m just trying to make it easier to the user to not see the code in that column:

    If TCol = 8 Then
    Cells(Target.Row, "J").FormulaR1C1 = "=IF(RC8="""","""",RC8+40)"
    Cells(Target.Row, "I").FormulaR1C1 = "=IF(RC8="""","""",RC8+40)"
    End If
    If anyone has two minutes to figure out how to add the second line to make the same thing but to do a paste special.values instead.

    So in other words, if I add a date to Column H then it will add the same date in J but with a +40 and copy column J to paste.speacial.values in column I.

  2. #2
    Registered User
    Join Date
    03-26-2012
    Location
    India
    MS-Off Ver
    excel 2007
    Posts
    21

    Re: VB Paste.Speacial.values

    wouldnt this work?
    If TCol = 8 Then
    Cells(Target.Row, "J").FormulaR1C1 = "=IF(RC8="""","""",RC8+40)"
    Cells(Target.Row, "I").value=Cells(Target.Row, "J").value
    End If

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: VB Paste.Speacial.values

    rounakbhasin you are the man... Yes works perfect :D

    Thank you so much

+ 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