Copy and Paste Values of one cell into another Macro

starfox_64

New Member
Joined
Aug 3, 2020
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Here's the deal. When I click on the "Backlog" button, cell E27 changes to a new number. I want the value of E27 to be copied to cell E35 before it changes. And from there to E36 when I click on "Backlog" again, etc etc. This way I can see the historical trend as E27 changes throughout the day.

1596482026216.png


This is what I have so far, but it simply pastes E27 to E35 an infinite amount of times.

Sub ChartSectionCopy()
Dim i As Long

For i = 1 To Worksheets("Chart Names").Range("E27").Value
Range("27").Select
Selection.Copy
Range("E35").Offset(8, 0).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Next i

End Sub


Does anyone know how to fix this?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Without button.
VBA Code:
Dim x As Variant

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("E27")) Is Nothing Then Cells(Cells(34, 5).End(xlDown).Row + 1, 5).Value = x
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Intersect(Target, Range("E27")) Is Nothing Then x = Target.Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,878
Messages
6,127,506
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top