Between Sheets

fvcyo

New Member
Joined
Sep 2, 2004
Messages
16
I have information in a cell of sheet1 and desire to place it in another cell in sheet2 I can do it by a reference but if I erase the value of the cell of sheet1 i like to keep the value in the cell of sheet2

i want to do this automatic if i delete a cell of sheet1 don't erase a cell in sheet2. i can do with copy-paste special but i try a difference way. Anyone Help me..
 
If i got it well, you have some =sum functions, that when you change numbers you want the total to be copied at sheet2?
e.g. =sum function is at "a6". if you change any number from "a1" to "a5", you want "a6" to be copied at sheet2; is that right?
If so, your sums are in row (horizontial) or in column (vertical)?
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
If i got it well, you have some =sum functions, that when you change numbers you want the total to be copied at sheet2?
Yes
e.g. =sum function is at "a6". if you change any number from "a1" to "a5", you want "a6" to be copied at sheet2; is that right?
Yes
If so, your sums are in row (horizontial) or in column (vertical)?
Colum
If i got it well, you have some =sum functions, that when you change numbers you want the total to be copied at sheet2?
e.g. =sum function is at "a6". if you change any number from "a1" to "a5", you want "a6" to be copied at sheet2; is that right?
If so, your sums are in row (horizontial) or in column (vertical)?
 
Upvote 0
I hope that this is what you are looking for (it assumes that all your sum functions are placed in columns and at the bottom):
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CheckRow As Long, NextRow As Long, LastRow As Long, ws As Worksheet
CheckRow = Target.Row
NextRow = CheckRow + 1
LastRow = Cells(65536, Target.Column).End(xlUp).Row
Set ws = Sheet2
With Target
    If Cells(NextRow, .Column).Value = "" Then Exit Sub
    If Not ws.Range("iv1").Value = "" Then
        If MsgBox("Copied Data Row is full." & Chr(10) & "Do you want to clear?", _
        vbCritical + vbYesNo) = vbYes Then ws.Rows(1).ClearContents
    End If
    Do
        If Cells(CheckRow, .Column).HasFormula Then
            If ws.Range("a1").Value = "" Then
                ws.Range("a1").Value = Cells(CheckRow, Target.Column).Value
            Else
                ws.Range("iv1").End(xlToLeft).Offset(, 1).Value = Cells(CheckRow, Target.Column).Value
            End If
            Exit Do
        Else
            CheckRow = CheckRow + 1
        End If
    Loop While CheckRow <= LastRow
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,636
Members
452,662
Latest member
Aman1997

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