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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:39:19+00:00 2026-05-23T20:39:19+00:00

I am writing an application in VBA for excel. Using some conditions and counting

  • 0

I am writing an application in VBA for excel. Using some conditions and counting the number of records by the following functions which is working fine.

   cnt = appExcel.Application.CountIfs(R1, AuditType, R2, "Fail", UserRange1, UserName & "*")

Here R1,R2 and UserRange1 are Range types which is describing individual cells.
If we print

R1.Address  '$E:$E
R2.Address ' $M:$M so on.

I am getting the number of rows present with those criteria in “cnt” variable.

I need further manipulation like searching some custom cells from the above range of cells. To do that I need to store those addresses in a “Range” object.
Please guide me how can I store those filtered records in a range. I don’t want to copy to another area also.

  • 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-23T20:39:20+00:00Added an answer on May 23, 2026 at 8:39 pm

    You add a new range to a worksheet by declaring a Name object in VBA and then setting it’s RefersTo value to the address. This example adds the needed declarations and code to do this. It assumes that you are interested in the cells in your R1 range which contain constants:

    Dim rngFiltered As Excel.Range
    Dim nmNew As Excel.Name
    
    '...
    
    Set rngFiltered = R1.SpecialCells(xlCellTypeVisible)
    Set nmNew = ws.Names.Add(Name:="NewRange", RefersTo:="=" & rngFiltered.Address)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing application, which connects to CRM using CRM SDK 4. In the first
I am writing application using PhoneGap on Android. I need to call some PhoneGap
I'm writing an application to use in the lumber yard. Given a number of
I'm writing web application using codeigniter framework. Here is the structure of document root
I'm writing an application that on some stage performs low-level disk operations in Linux
im writing application on asp mvc. so, i have jQuery tabs on index.aspx, which
I'm writing application which consists of server side on Google App Engine (Java) and
I'm trying to rewrite some VBA code in Excel VSTO. The VBA code is
I am writing application using c++, in windows. I want to get a thumbnail
Background I'm writing application for android, using Eclipse in Windows. I'm implementing C code

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.