Transferring values to another workbook

BradleyN1

New Member
Joined
May 5, 2017
Messages
25
Office Version
  1. 365
Platform
  1. Windows
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:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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
 
Upvote 0
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:)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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