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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:56:39+00:00 2026-06-12T12:56:39+00:00

i got the vba code to display msgbox by checking one value. If Range(AH4).Value

  • 0

i got the vba code to display msgbox by checking one value.
If Range(“AH4”).Value Then
MsgBox “tablespace greater than 95”

but i want to check a whole column of about 50 values and i want a looping code that traverses through the whole column and displays a msgbox if any of the value is greater than 95.
A B C D
1 Tablespace Total Size(Mb) Total Free(MB) PCT_USED
2 MONITOR 100 99 1
3 PSAPSR3 73,940 3,992 94.6
4 PSAPSR3702 84,960 24,391 71.29
5 PSAPSR3USR 40 16 61
6 PSAPUNDO 9,260 9,221 0
7 SYSAUX 760 51.3125 93
8 SYSTEM 1,470 9.75 99

Now i want to refine the solution given by chris.
1. I want my msgbox should display the actual value of the cell it finds greater than 95 under PCT_USED.
2. And that msgbox should display the name of the corresponding tablespace under the column A(i have freezed this column in my excel sheet).

  • 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-12T12:56:41+00:00Added an answer on June 12, 2026 at 12:56 pm

    You don’t need to loop for this.

    Try

    Sub TestRange()
        Dim rng As Range
    
        Set rng = [F1:F10]  ' <-- adjust to your requirements
        If Application.WorksheetFunction.Max(rng) > 95 Then
            MsgBox "tablespace greater than 95"
        End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a very simple VBA function that takes two range arguments and returns
I've got some old Excel VBA code where I want to run a task
Got a trouble in a VBA excel program. Sub code(s) ... code = t
I've got some VB code (actually VBA) which is basically the same except for
I've got an Excel 2007 VBA script that adds a button to the ribbon,
Got a programm with 2 threads. one thread is writing some stuff into the
I had some existing VBA code that was building queries using string concatenation. I
I've got a question that probably has a pretty simple answer, but I didn't
Okay, i've got an Outlook 2003 VBA macro that clears a mail item's categories,
I've got a compilation error in Excel VBA, which I don't understand... I've got

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.