+ Reply to Thread
Results 1 to 3 of 3

code on how to refer to a hide worksheet so can i get my unique id number

  1. #1
    Registered User
    Join Date
    03-03-2015
    Location
    philippines
    MS-Off Ver
    2010
    Posts
    4

    code on how to refer to a hide worksheet so can i get my unique id number

    hope someone can help mebase Sheets"Database" is hide. I always get an error "select method of range class failed"

    here's my code

    Private Sub txtboxidnumber_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    If txtboxidnumber.Value = True Then

    Sheets("Database").Range("A101").Select
    Range(Selection, Selection.End(xlDown)).Select

    If (Selection.Find(What:=txtboxidnumber.Value, After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=True, SearchFormat:=False)) Is Nothing Then

    txtdate.Value = ""
    txtissues.Value = ""
    MsgBox ("No Record Found")
    Else

    iRow = (Selection.Find(What:=txtboxidnumber.Value, After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=True, SearchFormat:=False).Row)

    txtdate.Value = Range("B" & iRow).Value
    Me.txtdate.Enabled = False
    cmbOU.Value = Range("C" & iRow).Value
    Me.cmbOU.Enabled = False
    cmbclassification.Value = Range("D" & iRow).Value
    Me.cmbclassification.Enabled = False
    txtissues.Value = Range("E" & iRow).Value
    Me.txtissues.Enabled = False
    txtresolution.Value = Range("F" & iRow).Value
    Me.txtresolution.Enabled = False
    cmbactionby.Value = Range("G" & iRow).Value
    Me.cmbactionby.Enabled = False
    txtpriority.Value = Range("H" & iRow).Value
    Me.txtpriority.Enabled = False
    cmbstatus.Value = Range("I" & iRow).Value
    Me.cmbstatus.Enabled = False
    txtdateresolved.Value = Range("J" & iRow).Value
    Me.txtdateresolved.Enabled = False

    With UserForm2
    txtboxidnumber.SetFocus
    End With
    End If

    'ws.Cells(iRow, 1).Value = Me.txtboxidnumber.Value
    'ws.Cells(iRow, 2).Value = Me.txtdate.Value
    'ws.Cells(iRow, 3).Value = Me.cmbOU.Value
    'ws.Cells(iRow, 4).Value = Me.cmbclassification.Value
    'ws.Cells(iRow, 5).Value = Me.txtissues.Value
    'ws.Cells(iRow, 6).Value = Me.txtresolution.Value
    'ws.Cells(iRow, 7).Value = Me.cmbactionby.Value
    'ws.Cells(iRow, 8).Value = Me.txtpriority.Value
    'ws.Cells(iRow, 9).Value = Me.cmbstatus.Value
    'ws.Cells(iRow, 10).Value = Me.txtdateresolved.Value
    End If
    End Sub

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: code on how to refer to a hide worksheet so can i get my unique id number

    Hi,
    Unfortunately your post does not comply with Rule 3 of our Forum
    RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-03-2015
    Location
    philippines
    MS-Off Ver
    2010
    Posts
    4

    Re: code on how to refer to a hide worksheet so can i get my unique id number

    sorry for that as i am new here :

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 07-25-2012, 11:05 PM
  2. VBA code to hide defined names in worksheet
    By lealea1982 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2010, 06:01 AM
  3. How to refer code to specific range in worksheet
    By gulaina in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2010, 04:16 AM
  4. I need a unique number to be created per worksheet
    By Roy Tamir in forum Excel General
    Replies: 2
    Last Post: 04-21-2006, 08:45 AM
  5. [SOLVED] Refer to Worksheet Ranges in Code
    By Andibevan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-30-2005, 08:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1