LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.office.developer.com.add_ins,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 59
Default How to make userform work publically with hidden sheets?

I need help I am unsure of what is going on. I have five userforms
and five worksheets.. and an additional worksheet for reference page.
The useforms are used to input data. There is a complex code that
denies any duplicate data to be entered into the referring worksheet,
example sheet1 is used to store userform1's data so if you enter 2
into userform1 sheet1 will not store it if 2 is already in sheet1. It
is all controlled by code stored in the userform data validation;
validate then input. The problem is that the sheets will ultimately be
hidden from view and the reference page will be left standing alone.
When I go to implement this task there is a issue of getting the
validation code to work for duplicate data. The duplicate data code
only works when the sheet that you are trying to enter data into is
open and selected????? Is there anyone who understands what I am saying
and knows a way to help me.

Example:

Private Sub Save_Click()
If ValidateData = True Then
EnterDataInWorksheet
Unload Me
With Application
If .WorksheetFunction.CountIf(.Range("a2:a100"), FirstName.Value) = 1
Then
Unload Me
'more code...
Else

End If
'other action
End With
End If
End Sub

I tried storing the code into the save button along with the validate
data I am unsure of Private and Public?

Here is code in validate

Public Function ValidateData() As Boolean
' Returns True if the data in the user form
' is complete, False otherwise. Displays a
' message identifying the problem.
With Application
If .WorksheetFunction.CountIf(.Range("a2:a100"), FirstName.Value) = 1
Then
MsgBox "alert duplicate data", 16, "input!"
Unload Me
'more code...
Else

End If
'other action
End With
If FirstName.Value = "" Then
MsgBox "You must enter a First Name."
ValidateData = False
Exit Function
End If
ValidateData = True
End Function

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hidden Sheets QUESTION-MARK Excel Worksheet Functions 4 May 19th 06 07:06 PM
Macro and hidden sheets Metallo Excel Discussion (Misc queries) 7 January 19th 06 09:33 AM
Number of worksheet tabs as cell value? ie 4 work sheets = 4 cell value [email protected] Excel Discussion (Misc queries) 2 November 22nd 05 05:17 PM
Open hidden sheets from a drop down list selection Ant Excel Discussion (Misc queries) 3 October 7th 05 10:01 AM
make hidden window or workbook visible without specify the name mango Excel Worksheet Functions 1 December 30th 04 03:05 PM


All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"