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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,223,275
Messages
6,171,123
Members
452,381
Latest member
Nova88

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