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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:19:54+00:00 2026-06-11T09:19:54+00:00

I am making a vbscript that is outputting to an excel spreadsheet. This will

  • 0

I am making a vbscript that is outputting to an excel spreadsheet.
This will be run on multiple systems on different days, so I want to make the name of the spreadsheet
hostname&date.xls

How can I do a save as on it, I’ve been googling but can’t find it.

Also, I only have two columns but some text in the second column will be either “Test PASSED” or “Test FAILED”. There are about 25 rows. I want to make it so the rows that have “TEST PASSED” in the second column are green and then red vice versa.

How should I go about this?

  • 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-11T09:19:55+00:00Added an answer on June 11, 2026 at 9:19 am

    I would prefer conditional formatting:

      With Table1.Range("$A:$A,$B:$B").FormatConditions.Add( _
            Type:=xlExpression, _
            Formula1:="=AND($B1=""Y"")")
    
       .Interior.Color = RGB(255, 0, 0)
      End With
    
      With Table1.Range("$A:$A,$B:$B").FormatConditions.Add( _
            Type:=xlExpression, _
            Formula1:="=AND($B1=""X"")")
    
       .Interior.Color = RGB(0, 255, 0)
      End With
    

    Feel free to replace Table1 with any other table object.

    This will ADD new Format conditions every time one is executing this code.

    To create your filename you can use Format(Now,"dd/mm/yyyy") and the code of Omnikrys – or a FileDialog-Object.

    Here a full example:

    ActiveWorkbook.SaveAs Environ$("computername") & "_" & Format(Now, "dd-mm-yyyy") & ".xlsx"

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

Sidebar

Related Questions

I have a vbscript that I want to run in the <head> of an
Making a simple program which will generate a multiple choice form. I have an
We have a custom action that we want to run ONLY on a major
Making an adobe flex ui in which data that is calculated must use proprietary
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created
Making UML sequence diagram in VS 2010RC I've observed that there is no activation
Making websites that appear correctly in IE is a big problem. Is there any
Making a flash page that can cycle through these three images on mouseclick. For
Making an Flex App. Just wondering if anyone has created something that fits automatically
Making a small WCF test program which is based on a Store that has

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.