+ Reply to Thread
Results 1 to 6 of 6

Thread: Problems Pasting Values

  1. #1
    Registered User
    Join Date
    09-20-2011
    Location
    Belfast
    MS-Off Ver
    Excel 2007
    Posts
    31

    Problems Pasting Values

    Hello,

    I'm not really sure how to describe my problem and as such can't think what to search for. Here's the problem; I have a macro that pastes values into column B and then in column A puts the formula =IF(B2=D2,"","Change Detected")

    The formula in column A doesn't appear to pick up that there is anything in column B unless I select cell B2, click in the formula bar and hit enter and repeat this all the way down column B.

    Does anyone know why this is and how I can stop it happening?

    Thanks,

    Dean

  2. #2
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    189

    Re: Problems Pasting Values

    Cut and paste your macro in here, need to see it.

  3. #3
    Registered User
    Join Date
    09-20-2011
    Location
    Belfast
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Problems Pasting Values

    Range("B2").Select
        Do
        ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[1],"":00"")"
        ActiveCell.Offset(1, 0).Select
        Loop Until IsEmpty(ActiveCell.Offset(0, 4))
        Columns("B:B").Select
        Selection.Copy
        Columns("B:B").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    Range("A2").Select
        Do
        ActiveCell.FormulaR1C1 = "=IF(RC[1]=RC[3],"""",""Change Detected"")"
        ActiveCell.Offset(1, 0).Select
        Loop Until IsEmpty(ActiveCell.Offset(0, 5))
    Last edited by Dean81; 01-24-2012 at 09:26 AM.

  4. #4
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    189

    Re: Problems Pasting Values

    Try this instead.

    
    For DataSweep = 2 to Range("F65536").End(xlUp).Row
         Cells(datasweep, 2).formulaR1C1 = "=CONCATENATE(RC[1],"":00"")"
         Cells(datasweep, 1).formulaR1C1 = "=IF(RC[1]=RC[3],"""",""Change Detected"")"
    next datasweep
    
    Columns("B:B").Select
        Selection.Copy
        Columns("B:B").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
        range("a1").select

  5. #5
    Registered User
    Join Date
    09-20-2011
    Location
    Belfast
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Problems Pasting Values

    Thanks for the reply. Same thing is happening though

  6. #6
    Forum Contributor
    Join Date
    06-16-2011
    Location
    London
    MS-Off Ver
    Excel XP
    Posts
    189

    Re: Problems Pasting Values

    Can you post your workbook here as well? The above code works for me, there must be something about your workbook that's interfering.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0