![]() |
does workbook contain worksheet
I am creating a series of userforms that
1) checks if the open workbook contains a specific worksheet. 2) Loads a textbox in the form with data from a cell 3) allows the text to be added to 4) Re-loads the modified text to the cell 5) Saves the worksheet I am having trouble getting the sheet verification and the textbox to load the cell text. Any ideas? |
does workbook contain worksheet
'----------------------------------------------------------------- Function SheetExists(Sh As String, _ Optional wb As Workbook) As Boolean '----------------------------------------------------------------- Dim oWs As Worksheet If wb Is Nothing Then Set wb = ActiveWorkbook On Error Resume Next SheetExists = CBool(Not wb.Worksheets(Sh) Is Nothing) On Error GoTo 0 End Function -- HTH RP "asmenut" wrote in message ... I am creating a series of userforms that 1) checks if the open workbook contains a specific worksheet. 2) Loads a textbox in the form with data from a cell 3) allows the text to be added to 4) Re-loads the modified text to the cell 5) Saves the worksheet I am having trouble getting the sheet verification and the textbox to load the cell text. Any ideas? |
does workbook contain worksheet
Thank you Bob. I got the first part to work. Now for the second part,
Getting the TextBox to show the cell data. Everytime a workbook is open (that contains the Sheet), I get an "Out of Subscript" error. Private Sub UserForm_Initialize() Dim MRange As Range Sheets("Eo-Cover").Activate Set MRange = ActiveSheet.Range("B24") TMAffectText = MRange.Value End Sub "Bob Phillips" wrote: '----------------------------------------------------------------- Function SheetExists(Sh As String, _ Optional wb As Workbook) As Boolean '----------------------------------------------------------------- Dim oWs As Worksheet If wb Is Nothing Then Set wb = ActiveWorkbook On Error Resume Next SheetExists = CBool(Not wb.Worksheets(Sh) Is Nothing) On Error GoTo 0 End Function -- HTH RP "asmenut" wrote in message ... I am creating a series of userforms that 1) checks if the open workbook contains a specific worksheet. 2) Loads a textbox in the form with data from a cell 3) allows the text to be added to 4) Re-loads the modified text to the cell 5) Saves the worksheet I am having trouble getting the sheet verification and the textbox to load the cell text. Any ideas? |
All times are GMT +1. The time now is 09:38 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com