How to develop code that when I click the ok button, then the data will send to different two sheet?
How to develop code that when I click the ok button, then the data will send to different two sheet?
Can you be more specific?
Where / what is the data? Where is the button? When you say "sent to different two sheet" do you mean the same value copied into two separate cells on different worksheets, in the same workbook?
Please explain your requirements clearly. Attach a workbook if possible, showing exactly what your desired outcome looks like.
let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source
If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE
Walking the tightrope between genius and eejit...
13-2-2014 3-21-45 PM.jpg
Private Sub OKButton_Click()
Dim emptyRow As Long
'Make Sheet1 active
Sheet1.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 3).Value = Ce.Value
Cells(emptyRow, 2).Value = Date
Cells(emptyRow, 5).Value = PhoneTextBox.Value
Cells(emptyRow, 7).Value = ComboBox1.Value
Cells(emptyRow, 6).Value = casetype.Value
Cells(emptyRow, 4).Value = DinnerComboBox.Value
Cells(emptyRow, 1).Value = qe.Value
If PosteriorOptionButton1.Value = True Then
Cells(emptyRow, 8).Value = "Major"
Else
Cells(emptyRow, 8).Value = "Minor"
End If
Cells(emptyRow, 9).Value = MoneyTextBox.Value
End Sub
Sorry for lack of information.. This is the screenshot and the code behind. What code I should add in in order to have that kind of effect?
Please wrap CODE tags around any code you post.
It's also much easier to work with an attached workbook, rather than a JPG.
You need to assign two 'last row' variables, one for each sheet, and qualify the destination cells with the appropriate worksheet - for example:
You should get the idea, and be able to complete your code based on this example...Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks