Transferring values to another workbook

BradleyN1

New Member
Joined
May 5, 2017
Messages
17
Sorry I meant sheet not workbook

Hi

I have 1 workbook, example, I have 1 sheet named 'Calls', in cell C4 a value will be entered for example '1 day'
I have another sheet on the bottom 'Collection' I want it to log/copy '1 day', from A1. But I still want this info to remain on 'Collection' even when '1 day' is deleted. Then I want it to jump onto row A2 ready for when a value is input again

So,
'1 day' is inputted into C4
On the other sheet starting from A1 it will log '1 day' then jump onto the next line when anything else is inputted onto C4

Hope that makes sense

Thanks
 
Last edited:

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
10,136
Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your "Calls" sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a value in C4 and exit the cell.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("C4")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Dim bottomA As Long
    bottomA = Sheets("Collection").Range("A" & Rows.Count).End(xlUp).Row
    If Sheets("Collection").Range("A1") <> "" Then
        Sheets("Collection").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) = Target
    Else
        Sheets("Collection").Range("A" & bottomA) = Target
    End If
    Application.ScreenUpdating = True
End Sub
 

BradleyN1

New Member
Joined
May 5, 2017
Messages
17
Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your "Calls" sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a value in C4 and exit the cell.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("C4")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Dim bottomA As Long
    bottomA = Sheets("Collection").Range("A" & Rows.Count).End(xlUp).Row
    If Sheets("Collection").Range("A1") <> "" Then
        Sheets("Collection").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) = Target
    Else
        Sheets("Collection").Range("A" & bottomA) = Target
    End If
    Application.ScreenUpdating = True
End Sub


You help is greatly appreciated, many thanks:)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,886
Messages
5,598,660
Members
414,252
Latest member
Tejeci

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
Top