VBA to populate cells in another sheet

ForumMember

Board Regular
Joined
Sep 10, 2011
Messages
57
Hi all,

What I would like to do is have 2 fields (cbo1 & cbo2) in my Userform (Userform1) populate 2 cells (a12 & c40) in a seperate workbook (c:filepath/filename) when I click submit.

Now, I would like this option to execute only if my checkbox is executed:

Code:
Private Sub ChkCorrection_Click()
    Workbooks.Open FileName:= _
        "c:IssueLog.xls"
    Windows("Real.xlsm").Activate
End Sub
Code:
Private Sub cmdSubmit_Click()
    ActiveWorkbook.Sheets("Issue Log").Activate
    Range("A1").Select
    Do
    If IsEmpty(ActiveCell) = False Then
    ActiveCell.Offset(1, 0).Select
 
    End If
    Loop Until IsEmpty(ActiveCell) = True
    ActiveCell.Value = txtDate.Value
    ActiveCell.Offset(0, 1) = txtTime.Value
    ActiveCell.Offset(0, 2) = cboOperator.Value
 
 
    Unload Me
 
    Application.Quit
End Sub

Could anyone provide the code and indicate where it would sit in my Submit Button Code?

Many thanks in advance!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Tiny friendly bump - I hate needing help with these things, but my understanding is limited!

Again, any help would be sincerely appreciated! :)
 
Upvote 0

Forum statistics

Threads
1,224,604
Messages
6,179,857
Members
452,948
Latest member
UsmanAli786

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