Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find value in hide sheet and put into other sheet. (2000 sr 1)

    I have the sheet SALDI it contain a column D with many value (are the index for find)
    In the same wbook are present many sheet hided.(4510-003387, 4510-280028, ecc...)
    In each sheet are present into range F6 (the range is fixed for all sheet hided).
    Well, i would want to cicle each sheet hided and with the index into B4 for all sheet and index into column D of SALDI, insert the relative value into column G of sheet SALDI.
    Note: into wbook isd present a macro i use to cicle the sheet
    Example are attached...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find value in hide sheet and put into other sheet. (2000 sr 1)

    It is not necessary to unhide and re-hide the worksheets, Excel can search in hidden sheets. Try this:

    Sub LOOPSHEET_SALDI()
    Dim i As Long
    Dim oCell As Range
    Application.ScreenUpdating = False

    For i = 1 To Worksheets.Count
    If Mid(Worksheets(i).Name, 5, 1) = "-" Then
    ' Try to find the value of B4 in column D on SALDI
    Set oCell = Worksheets("SALDI").Range("D").Find _
    (What:=Worksheets(i).Range("B4"), LookAt:=xlWhole)
    If Not oCell Is Nothing Then
    ' If found. then set value of corresponding cell in column G
    oCell.Offset(0, 3) = Worksheets(i).Range("F6")
    End If
    End If
    Next

    Application.ScreenUpdating = True
    End Sub

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find value in hide sheet and put into other sheet. (2000 sr 1)

    ...."It is not necessary to unhide and re-hide the worksheets" I dont know this option...
    Good lesson, and tks for code.

Posting Permissions

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