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

  • SEARCH
  • Home
  • 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 6999253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:31:03+00:00 2026-05-27T20:31:03+00:00

Below is the code I have so far. I am trying to do the

  • 0

Below is the code I have so far. I am trying to do the following:

Compare the “ICT number” to the name of worksheet and if that worksheet name contains the ICT number, even if it is mixed in with other string values, then i want to look at a certain cell in that worksheet and compare the value in that cell with a cell in my checklist worksheet.

If those values are the same, then i want to have a message come up in a corresponding cell on that row saying that the two sources reconcile.

I then want this to loop for all of the rows in the checklist worksheet and all of the worksheets in the workbook.

Dim ICT_Number As Range
Dim statmentdata As Range
Dim checklistdata As Range
Dim Worksheet As Variant
Dim reconcile As Range

For Each cell In Range("d6:d236")

Set ICT_Number = ActiveCell
Set statementdata = Worksheets("m0017 v p0903").Range("H2016")
Set checklistdata = ActiveCell.Offset(0, 5)
Set currsheet = Worksheets("m0017 v p0903")
Set reconcile = ActiveCell.Offset(0, 11)

If InStr(1, cell, ICT_Number, 1) Then
    If statmentdata = checklistdata Then
        reconclie.Value = "this line reconiles"
    Else
        reconcile.Value = "this line does not reconclie"
    End If
  Next cell
End Sub
  • 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-05-27T20:31:03+00:00Added an answer on May 27, 2026 at 8:31 pm

    You have several issues in your code:

    Don’t use protected (or ambiguous) names for your variables.

    Please DON’T DO:

    Dim Worksheet As Variant
    

    Better do:

    Dim ws as Worksheet
    

    Use Set when assigning an object

    This WON’T work:

    currsheet = Worksheets("statement n0246 v ab119")
    

    Instead, do:

    Set currsheet = Worksheets("statement n0246 v ab119")
    

    What your code could look like

    Sub test()
    
    Dim ICT_Number As Range
    Dim statmentdata As Range
    Dim checklistdata As Range
    Dim Worksheet As Variant
    Dim reconcile As Range
    
    Set ICT_Number = Worksheets("checklist").Range("D79")
    Set statementdata = Worksheets("n0246 v ab119").Range("H2016")
    Set checklistdata = Worksheets("checklist").Range("H79")
    Set currsheet = Worksheets("statement n0246 v ab119")
    Set reconcile = Worksheets("checklist").Range("N79")
    
    If currsheet.Name = ICT_Number Then
        If statmentdata = checklistdata Then
            reconclie.Value = "this line reconiles"
        Else
            reconcile.Value = "this line does not reconclie"
        End If
    End If
    End Sub
    

    Before anything else

    Please have a look at a VBA Tutorial to learn the syntax: VBA: Basic Syntax and Examples Tutorial

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

Sidebar

Related Questions

So far i have got the code below which works lovely when trying an
Below I have the code that allows me to edit a table row inline.
I have the following code below to generate an OpenSSL RSA public and private
I'm trying to compare two arrays in groovy. My attempts so far have yielded
I have code below: <select id=testSelect> <option value=1>One</option> <option value=2>Two</option> </select> <asp:Button ID=btnTest runat=server
I have below code in html. <li class=selected runat=server id=lihome><a href=/ISS/home.aspx title=Home><span>Home</span></a></li> Now I
I have below code behind in c# if (Session[cmpDictionaryTitle]!= null) { downloadLinks.Text += @<li><a
I have below code to insert a style into DOM (there is a use
In my code I have 2 ComboBox DropDownLists, created by the code below. The
I have the below code in stdafx.h. using namespace std; typedef struct { DWORD

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.