How to copy a cell from one worksheet to a cell in another?

aesta

New Member
Joined
Aug 15, 2017
Messages
6
Currently have a user form and data table where new entries in the user form go to the end of the data table in a worksheet called "Data Inputs", with the following relevant code:

Dim iRow2 As Integer
Dim Data1 As Range
iRow2 = Worksheets("Data Inputs").Cells(Rows.Count, 6).End(xlUp).Row + 1
Set Data1 = Worksheets("Data Inputs").Range("B" & iRow2)
Data1 = TextBox1.Value

TextBox1 is the text box in the user form, for which the value is being taken from. This part works with no problems.

The next thing I would like to do is take that same value and copy it into Cell C14 of a worksheet called "FT1 Data". This part would be a separate sub from the code above and would just be called within that code. I used the following code, but it doesn't seem to work:

Worksheets("FT1 Data").Range("C14") = Worksheets("Data Inputs").Range("B" & iRow2)


Any help would be much appreciated! Thanks in advance!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
why not just do
Code:
Worksheets("FT1 Data").Range("C14")=TextBox1.Value
rather then calling a separate sub?
If you want to keep it as a separate sub, then we'll need to see the code for that sub & the complete code for the extract you've shown
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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