Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Trenton, Ontario
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy Paste Macro (2000)

    I am trying without success to get a macro to change a cell in col D from a formula to a value using paste special/value when the corresponding cell in col J changes. When a cell in col J changes it will always be the last cell in that column. The macro below isn't working because it's looking at the cells in col D and it stops when there is formula there (even though the result of the formula is ""). How do I get cell D? to copy and paste a value to the same cell when J? changes. Below is the macro I have been trying.

    Private Sub worksheet_change(ByVal Target As Excel.Range)
    If Not Intersect(Target, Worksheets("Log").Range("J:J")) Is Nothing Then
    Sheets("Log").Range("D2000").End(xlUp).Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Application.CutCopyMode = False

    End If
    End Sub

    Thanks in advance for any help you may offer.
    Stats

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Copy Paste Macro (2000)

    Stats, try

    Sheets("Log").Range("D2000").End(xlUp).Select
    Selection.Value = Selection.Value

    (could be simplified further, but I'll leave the .Select in on the basis that is where you want the cursor to be)
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •