passing data between worksheets

CL HND

New Member
Joined
Jul 13, 2009
Messages
20
Hi,
I have created a userform in that it asks multiple users to identify a row on a worksheet and then I want to analyze and pass some of the data to another worksheet. I have the code below. I'm having trouble obtaining data for the variables "locationcxs" and "details." Any help in steering me in the right direction is much appreciated.


Private Sub UserForm_Initialize()
Dim ws As Worksheet
Dim locationcxs As String
Dim details As String


'Empty CSXBox
CSXBox.Value = ""

'Fill DigComboBox1
With DigComboBox1
.AddItem "2007 ePlanner"
.AddItem "2012 ePlanner"
.AddItem "2007 FRW"
.AddItem "AMS"
.AddItem "ePresentations"
.AddItem "eToolkit"
.AddItem "EMIS"
.AddItem "Examview"
.AddItem "iMRB"
.AddItem "iSRB"
.AddItem "iTLG"
.AddItem "Spanish Resources"
.AddItem "Student Home Page"
.AddItem "Teacher Home Page"
End With

'Set Focus on NameTextBox
CSXBox.SetFocus
Worksheets(1).Activate

End Sub


Private Sub CSXBox_Change()
End Sub


Private Sub DigComboBox1_Change()
End Sub

Private Sub CommandButton1_Click()

'Modify print sheet with digital component

On Error Resume Next
Range("A1").Activate
Range("A:A").Find(What:=CSXBox.Value, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 4).Activate
ActiveCell.Value = DigComboBox1.Value & ", " & ActiveCell.Value
ActiveCell.Offset(0, -4).Activate


'Copy CSX# to appropriate digital component sheet
Set ws = Worksheets(DigComboBox1.Value)
ws.Activate
NextRow = Range("A" & Rows.Count).End(xlUp).Row + 1
Range("A" & NextRow).Value = CSXBox.Value

'Copy print correx to appropriate digital component sheet
Worksheets(1).Activate
locationcxs = ActiveCell.Offset(0, 9).Value
ActiveCell.Offset(0, 9).Copy
ws.Activate
Range("B" & NextRow).Value = locationcxs.Value


'Copy print detail correx to appropriate digital component sheet
Worksheets(1).Activate
details.Value = ActiveCell.Offset(0, 10).Value
ActiveCell.Offset(0, 10).Copy
ws.Activate
Range("C" & NextRow).Value = details.Value

Unload Me

End Sub


Private Sub CommandClose_Click()
Unload Me
End Sub


Private Sub Label1_Click()
End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,224,532
Messages
6,179,388
Members
452,908
Latest member
MTDelphis

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