Updating from Userform to multiple sheets

petaaalouise

New Member
Joined
Apr 23, 2015
Messages
23
Hi,


I have a userform which updates specific data in my sheets. I have a code that updates the data but will only update one of the sheets(Usually the closed to the master).
Also the code is written to not update the "Master"

I'll post the code. Ant help would be greatly appreciated.


Private Sub CommandButton4_Click()
Dim lst As Range
Dim i As Long
For i = 1 To ThisWorkbook.Sheets.Count
If Sheets(i).Name <> "Master" Then Sheets(i).Select Replace:=False
Next i

With Sheets
Set lst = Range("B:B")
Set lst = lst.Find(What:=Me.TextBox1.Value, After:=Range("B11"), LookAt:=xlWhole)
If lst Is Nothing Then
Me.TextBox1.SetFocus
Exit Sub

Else: lst.Offset(0, 1).Value = Me.TextBox2.Value
End If


End With
MsgBox "You have successfully updated Transmittal. "

Unload Me
Call UserForm_Initialize


End Sub
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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