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 7935751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:01:04+00:00 2026-06-03T22:01:04+00:00

This code works perfectly. I only have one question, I want to make it

  • 0

This code works perfectly. I only have one question, I want to make it so that if there is nothing in cell Q23 that it will not put anything into NCMR Data, and say something… the code is below of what I have, and below it is what I think I need to do to a specific section to work, can someone review and make sure I am on the right path?

Option Explicit

Sub NCMR()
    Dim i As Integer

    With Application
        .ScreenUpdating = False
    End With

    'Internal NCMR
    Dim wsInt As Worksheet
    Dim wsNDA As Worksheet

    'Copy Ranges
    Dim c As Variant

    'Paste Ranges
    Dim P As Range

    'Setting Sheet
    Set wsInt = Sheets("NCMR Input")
    Set wsNDA = Sheets("NCMR Data")
    Set P = wsInt.Range("B61:V61")

    With wsInt
        c = Array(.Range("B11"), .Range("B14"), .Range("B17"), .Range("B20"), .Range("Q23"), .Range("B23") _
                , .Range("Q11"), .Range("Q14"), .Range("Q17"), .Range("Q20"), .Range("R26"), .Range("V23") _
                , .Range("V25"), .Range("V27"), .Range("B32"), .Range("B40"), .Range("B46"), .Range("B52") _
                , .Range("D58"), .Range("L58"), .Range("V58"))
    End With

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

    With wsNDA
        Dim LastRow As Long

        LastRow = .Range("A" & Rows.Count).End(xlUp).Row + 1

        wsInt.Rows("61").Copy

        With .Rows(LastRow)
            .PasteSpecial Paste:=xlPasteFormats
            .PasteSpecial Paste:=xlPasteValues
            .Interior.Pattern = xlNone
        End With

        With .Range("A" & LastRow)
            If LastRow = 3 Then
                .Value = 1
            Else
                .Value = Val(wsNDA.Range("A" & LastRow - 1).Value) + 1
            End If

            .NumberFormat = "0#######"
        End With
    End With

    With Application
        .Range("A61:V61").ClearContents
        .ScreenUpdating = True
    End With
End Sub

What I want to do I think:

With wsInt
    Dim f As Range

    Set f = .Cell("Q23")

        If IsEmpty(f) Then
            MsgBox "The data can't entered, you have not entered any data into the Sales Order field."
        Else
                    c = Array(.Range("B11"), .Range("B14"), .Range("B17"), .Range("B20"), .Range("Q23"), .Range("B23") _
                , .Range("Q11"), .Range("Q14"), .Range("Q17"), .Range("Q20"), .Range("R26"), .Range("V23") _
                , .Range("V25"), .Range("V27"), .Range("B32"), .Range("B40"), .Range("B46"), .Range("B52") _
                , .Range("D58"), .Range("L58"), .Range("V58"))
        End If
End With
  • 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-03T22:01:05+00:00Added an answer on June 3, 2026 at 10:01 pm

    Maybe as simple as:

    With wsInt 
        If Len(.Range("Q23")) = 0 Then
            MsgBox "The data can't be entered, you have not entered any data into the Sales Order field."
            Exit Sub
        End If
    End With      'added this line for clarity
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code that works perfectly to post one object to my server.
This is kind of a brainteaser question, since the code works perfectly fine as-is,
I already asked a question today : This one Now I have a code
This code works perfectly in Ubuntu, Windows, and Mac OS X. It also works
This code works perfectly except when you click on a link, The page is
I am using ASP.NET to transmit a .jar file. This code works perfectly on
I have this code to write to a file, it works perfect but I
This code works (C# 3) double d; if(d == (double)(int)d) ...; Is there a
I have this php code that should take all the php files in a
Using this code to zip a folder and it works perfect on small files

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.