+ Reply to Thread
Results 1 to 22 of 22

Auto Population

Hybrid View

JustinZ Auto Population 10-22-2009, 08:51 AM
Rick_Stanich Re: Auto Population 10-22-2009, 09:11 AM
JustinZ Re: Auto Population 10-22-2009, 10:48 AM
Rick_Stanich Re: Auto Population 10-22-2009, 12:25 PM
JustinZ Re: Auto Population 10-22-2009, 12:35 PM
Rick_Stanich Re: Auto Population 10-22-2009, 12:55 PM
JustinZ Re: Auto Population 10-22-2009, 01:06 PM
Rick_Stanich Re: Auto Population 10-22-2009, 01:40 PM
JustinZ Re: Auto Population 10-22-2009, 02:11 PM
StephenR Re: Auto Population 10-22-2009, 02:42 PM
JustinZ Re: Auto Population 10-22-2009, 02:57 PM
Rick_Stanich Re: Auto Population 10-22-2009, 03:40 PM
JustinZ Re: Auto Population 10-22-2009, 03:50 PM
Rick_Stanich Re: Auto Population 10-22-2009, 04:09 PM
JustinZ Re: Auto Population 10-23-2009, 07:21 AM
JustinZ Re: Auto Population 10-23-2009, 07:31 AM
Rick_Stanich Re: Auto Population 10-23-2009, 10:13 AM
Rick_Stanich Re: Auto Population 10-23-2009, 01:38 PM
JustinZ Re: Auto Population 10-23-2009, 01:43 PM
Rick_Stanich Re: Auto Population 10-23-2009, 04:43 PM
JustinZ Re: Auto Population 10-26-2009, 09:22 AM
Rick_Stanich Re: Auto Population 10-26-2009, 09:29 AM
  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Re: Auto Population

    The find is finding the value, the code is backwards.

    Try this code: It searches the usedrange, not the entire 16,384 rows.
        Set pnfind = Cells.Find(What:=varPartNumber, After:=ActiveCell, LookIn:=xlValues, _
                LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                MatchCase:=False)
    
        'MsgBox pnfind.Address    'for testing
    
        If Not pnfind Is Nothing Then
        Dim LastRow As Long
        Dim iRowCount As Integer
    
        With ActiveSheet.UsedRange
            LastRow = .Rows(.Rows.Count).Row
        End With
        iRowCount = 1
        Do Until iRowCount = LastRow
            If Selection.Value <> varOperNo Then        'looks for oper no saved form before
                Selection.Offset(1, 0).Activate
            End If
            iRowCount = iRowCount + 1
        Loop
        Else
            MsgBox "The part number " & varPartNumber & " does not exist"
        End If
    This message box
    MsgBox pnfind.Address
    shows the address of the "pnfind" variable.

    This leads to the next error.
        ActiveCell.Offset(6, 0).Activate    'moves to new work center number and
        'copies cell value
        Selection.Copy _
                Destination:=SFCTimesNew(x, 12)
    The code in Red will fail because there is no value 6 rows down.

    Perhaps you can explain what needs to be copied from which cells to which cells.
    Seems like you are changing worksheet row/column formats (headings etc.)?
    Last edited by Rick_Stanich; 10-22-2009 at 04:13 PM.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Registered User
    Join Date
    10-22-2009
    Location
    Peckville, PA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Auto Population

    Maybe a little background will help, a few months ago we started a project that dealt with determining and assigning new work centers to all our machines, and we went through what would be SFCTimesOld and manually input all the new work centers. Now a few months later we reran the report but I don't want to spend the hours it took to manually do it again, and since almost all the parts are still the same, I wanted to use SFCTimesOld to populate the new work center numbers in SFCTimesNew based on part number and operation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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