Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() '----------------------------------------------------------------- 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
maybe...
Private Sub UserForm_Initialize() if sheetexist("eo-cover",thisworkbook) then tmaffecttext.text = Sheets("Eo-Cover").Range("B24").value else tMAffectText.text = "missing sheet" end if End Sub asmenut wrote: 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? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy worksheet from one workbook to a master workbook | Excel Worksheet Functions | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
Copying A Worksheet From Each Open Workbook to an new Workbook | Excel Worksheet Functions | |||
How can I link cell colours from worksheet to worksheet/workbook? | Excel Worksheet Functions | |||
copy worksheet from closed workbook to active workbook using vba | Excel Worksheet Functions |