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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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
You are very welcome. :)
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,901
Members
449,097
Latest member
dbomb1414

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