Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7941317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:38:02+00:00 2026-06-03T23:38:02+00:00

I have two sheets, the first pulls the data from the second to print

  • 0

I have two sheets, the first pulls the data from the second to print out later.

I have three scripts on the first sheet. Print, Edit Update.

Print works flawlessly.

Edit works flawlessly.

Update is where my issue is.

When I update the form, four cells dance, their data changes without me making any changes on the sheet.

The first two are B17 and B20.

The second are Q23 and R25.

The problem is that the jumping of data is between all four cells. the Sales Order may jump to Part Revision, and the Part ID jumps to Sales order, and sometimes Sales Order jumps to NCMR Qty.

I can’t figure out why this is happening. The VBA code looks solid, can someone not only verify this is going on in their computer, but perhaps why it is happening?

Here is the sheet:

http://dl.dropbox.com/u/3327208/Excel/Edit%26Update.xlsm

Here is the code that is causing the problem.

Option Explicit

    Sub PENCMR()
        Dim i As Integer

        'Internal NCMR
        Dim wsPE As Worksheet
        Dim wsNDA As Worksheet
        Dim c As Variant 'Copy Ranges
        Dim P As Range 'Paste Ranges

        Application.ScreenUpdating = False

        'Setting Sheet
        Set wsPE = Sheets("NCMR Output")
        Set P = wsPE.Range("A63:V63")

        Set wsNDA = Sheets("NCMR Data")

        c = Array("AG6", "B11", "B14", "B17", "B20", , "Q23", "B23", "Q11", "Q14", "Q17", "Q20", "Q26", "V23" _
            , "V25", "V27", "B32", "B40", "B46", "B52", "D58", "L58", "V58")

        For i = LBound(c) To UBound(c)
            P(i + 1).Value = wsPE.Range(c(i)).Value
        Next

        With wsNDA
            Dim NR As Long, LR As Long, LC As Long
            Dim f As Range

            LR = .Range("C" & Rows.Count).End(xlUp).Row
            LC = .Cells(2, Columns.Count).End(xlToLeft).Column
            NR = LR + 1

            Set f = .Range("A3:A" & LR).Find(what:=P.Cells(1).Text, LookIn:=xlValues, lookat:=xlWhole)
            If Not f Is Nothing Then
                f.Resize(1, P.Cells.Count).Value = P.Value
            Else
                MsgBox "The data can't be shown, please review the data in question, if no problem can be found please contact the developer"
            End If
        End With
        Range("A63:V63").ClearContents

        With wsPE
            .Range("B11").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,2,FALSE),"""")"
            .Range("B14").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,3,FALSE),"""")"
            .Range("B17").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,4,FALSE),"""")"
            .Range("B20").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,5,FALSE),"""")"
            .Range("B23").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,7,FALSE),"""")"
            .Range("Q11").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,8,FALSE),"""")"
            .Range("Q14").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,9,FALSE),"""")"
            .Range("Q17").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,10,FALSE),"""")"
            .Range("Q20").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,11,FALSE),"""")"
            .Range("Q23").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,6,FALSE),"""")"
            .Range("R26").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,12,FALSE),"""")"
            .Range("V23").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,13,FALSE),"""")"
            .Range("V25").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,14,FALSE),"""")"
            .Range("V27").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,15,FALSE),"""")"
            .Range("B32").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,16,FALSE),"""")"
            .Range("B40").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,17,FALSE),"""")"
            .Range("B46").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,18,FALSE),"""")"
            .Range("B52").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,19,FALSE),"""")"
            .Range("D58").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,20,FALSE),"""")"
            .Range("L58").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,21,FALSE),"""")"
            .Range("V58").Formula = "=IFERROR(VLOOKUP($AG$6,'NCMR Data'!$A$2:$Y$999999,22,FALSE),"""")"
        End With

        Application.ScreenUpdating = True

    End Sub

I am now getting an error here.

P(i + 1).Value = wsPE.Range(c(i)).Value
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:38:03+00:00Added an answer on June 3, 2026 at 11:38 pm

    Error occurs because you have a blank space in array C at the 5th element.

    "AG6", "B11", "B14", "B17", "B20", , "Q23",
    

    Get rid of that and it will work. I just did and ran it flawlessly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a workbook with two sheets. The first is full of data and
i have two sheets having data like this sheet1 : **A** **B** **C** 752
I have a log list of data with the first two columns as potential
I have two bits of code. First a standard copy paste from cell A
I have a sheet in which I'm entering values in cell from two different
I have to compare two Excel files having different number of sheets, different number
I have a Excel sheet with two columns and I need to create new
I have an Excel sheet with two column, one is a number , and
I have two files lets say a.xls and b.xls . The first one contains
I have two columns, the first column will have the name of a object,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.