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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:11:01+00:00 2026-05-26T05:11:01+00:00

So I have been using in some macros coding to filter rows based on

  • 0

So I have been using in some macros coding to filter rows based on the values in one column. This has worked for what I’ve done in a general sense, but I’m needing to do some things that are a little more specific with the same stuff. What I have been using is follows this:

 Dim c As Range, x As Integer
'other code here
Set c = shtMaster.Range("Y5")  'Start search in Row 5
'other code  here
While Len(c.Value) > 0
        'If value in column Y ends with specified value,copy to report sheet
        If c.Value Like "*2130" Or c.Value Like "*0853" Then
'rest of macro follows

I’ve been trying to mess with the If line so that I can add conditions for the first four and last four digits instead of just using values based on the last four. For example, I may want to search Column Y for all values whose first four digits are “1234*” but whose last four digits are not “*5678”. So if I had a spreadsheet with:

     Column Y  

Row 1 12345678
Row 2 12341234
Row 3 12340000

then it would pull rows 2 and 3 but not row 1. I would like to use the structure above since that’s how everything is already written, but I can’t seem to get the syntax right. Is what I want to do possible with the structure I already have written? If so, any suggestions? Thanks.

  • 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-26T05:11:02+00:00Added an answer on May 26, 2026 at 5:11 am
    If c.Value Like "1234*" And Not c.Value Like "*5678" Then 
    
    'Values start with 1234 and do not end in 5678.
    
    End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using Perl for some time, but today I came across this
I have been using PLT Scheme , but it has some issues. Does anyone
Background I have been using Backbone.js for some time and one aspect of it
I've been using Mercurial for some development lately and have been loving it. I'm
I have been using the partial class modifier for some time in order to
I have been using com.sun.org.apache.xpath.internal.XPathAPI for some time and it seems to work ok.
I have been using ActiveResource in my Ruby on Rails applications for some time,
I have been using the AddressBook api of the iPhone for some time now.
I have a capistrano deployment recipe I've been using for some time to deploy
I have been having some issues with LINQ-To-SQL around memory usage. I'm using it

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.