Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why wont the following code work on a hidden worksheet? UserForm2 will be
used to place data on the hidden worksheet. Private Sub CommandButton1_Click() Unload UserForm3 Sheets("Engraving Jobs").Select Range("A1").Select UserForm2.Show 'Module3.Fill_ID_Down End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can't select a hidden worksheet, but you don't need to
Private Sub CommandButton1_Click() Unload UserForm3 UserForm2.Show Module3.Fill_ID_Down Sheets("Engraving Jobs") End Sub Change the Fill_ID_Down code to accept a worksheet reference and work with that sheet without selecting it. -- Regards, Tom Ogilvy "Patrick Simonds" wrote in message ... Why wont the following code work on a hidden worksheet? UserForm2 will be used to place data on the hidden worksheet. Private Sub CommandButton1_Click() Unload UserForm3 Sheets("Engraving Jobs").Select Range("A1").Select UserForm2.Show 'Module3.Fill_ID_Down End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am afraid you lost me. I entered the code as you suggested but I get the
following error "compile error wrong number of arguments or invalid property assignment" and when I click on debug .Fill_ID_Down Sheets (of the line Module3.Fill_ID_Down Sheets("Engraving Jobs")) is highlighted. You also mentioned Changing the Fill_ID_Down code to accept a worksheet reference and work with that sheet without selecting it. Below is the Sub Fill_ID_Down() and it does not reference the worksheet. Sub Fill_ID_Down() ' ' Fill ID down Macro Range("A" & Rows.Count).End(xlUp).AutoFill _ Destination:=Range("A" & Rows.Count).End(xlUp).Resize(2) End Sub End Sub "Tom Ogilvy" wrote in message ... You can't select a hidden worksheet, but you don't need to Private Sub CommandButton1_Click() Unload UserForm3 UserForm2.Show Module3.Fill_ID_Down Sheets("Engraving Jobs") End Sub Change the Fill_ID_Down code to accept a worksheet reference and work with that sheet without selecting it. -- Regards, Tom Ogilvy "Patrick Simonds" wrote in message ... Why wont the following code work on a hidden worksheet? UserForm2 will be used to place data on the hidden worksheet. Private Sub CommandButton1_Click() Unload UserForm3 Sheets("Engraving Jobs").Select Range("A1").Select UserForm2.Show 'Module3.Fill_ID_Down End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You get the error because you didn't modify Fill_ID_Down
Sub Fill_ID_Down(wks as Variant) ' ' Fill ID down Macro With wks .Range("A" & .Rows.Count).End(xlUp).AutoFill _ Destination:=.Range("A" & .Rows.Count).End(xlUp).Resize(2) End with End Sub -- Regards, Tom Ogilvy "Patrick Simonds" wrote in message ... I am afraid you lost me. I entered the code as you suggested but I get the following error "compile error wrong number of arguments or invalid property assignment" and when I click on debug .Fill_ID_Down Sheets (of the line Module3.Fill_ID_Down Sheets("Engraving Jobs")) is highlighted. You also mentioned Changing the Fill_ID_Down code to accept a worksheet reference and work with that sheet without selecting it. Below is the Sub Fill_ID_Down() and it does not reference the worksheet. Sub Fill_ID_Down() ' ' Fill ID down Macro Range("A" & Rows.Count).End(xlUp).AutoFill _ Destination:=Range("A" & Rows.Count).End(xlUp).Resize(2) End Sub End Sub "Tom Ogilvy" wrote in message ... You can't select a hidden worksheet, but you don't need to Private Sub CommandButton1_Click() Unload UserForm3 UserForm2.Show Module3.Fill_ID_Down Sheets("Engraving Jobs") End Sub Change the Fill_ID_Down code to accept a worksheet reference and work with that sheet without selecting it. -- Regards, Tom Ogilvy "Patrick Simonds" wrote in message ... Why wont the following code work on a hidden worksheet? UserForm2 will be used to place data on the hidden worksheet. Private Sub CommandButton1_Click() Unload UserForm3 Sheets("Engraving Jobs").Select Range("A1").Select UserForm2.Show 'Module3.Fill_ID_Down End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da | Excel Discussion (Misc queries) | |||
Hidden Columns No Longer Hidden after Copying Worksheet? | Excel Discussion (Misc queries) | |||
How do I detect hidden worksheets or hidden data on a worksheet? | Excel Discussion (Misc queries) | |||
Where's the hidden worksheet? | Charts and Charting in Excel | |||
Saving hidden data with a worksheet (preferably without using a hidden sheet) | Excel Programming |