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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:52:49+00:00 2026-05-23T13:52:49+00:00

I’m generating an Excel worksheet based on entries in a userform. One entry is

  • 0

I’m generating an Excel worksheet based on entries in a userform. One entry is a reporting interval over a project duration. Let’s say the reporting interval is three months and the duration of Phase2 is 10 months and Phase3 three months.

My columns are structured like this with the distance of one cell between phases:

Phase1: Starting phase
Phase2: Working phase
Phase3: Closing phase

Phase1  Phase2                      Phase3
||||||  ||||||||||||||||||||||||||| ||||||

The reporting intervals should be marked as colored cells in Phase2 and Phase3 like this:

Phase1  Phase2                        Phase3
||||||  |||||||O|||||||||||O||||||||  ||O||||

This is my code to color the cells:

For x = 1 To (Implementationduration + Closingduration - 1) / 3
            Select Case x
                Case Is < Implementationduration:
                    Call SetFontAndBackground(cells(Rowindex, Phase1CellLast() + Columncounter * 3), cells(Rowindex, Phase1CellLast() + Columncounter * 3), False, False, "", 10, False, "b", "lcyan", False)
                    Columncounter = Columncounter + 4
                Case Is > Implementationduration:
                    Call SetFontAndBackground(cells(Rowindex, Phase1CellLast() + Columncounter * 3 + 1), cells(Rowindex, Phase1CellLast() + Columncounter * 3 + 1), False, False, "", 10, False, "b", "lcyan", False)
                    Columncounter = Columncounter + 4
            End Select
Next x

Problem is that the colored cells in Phase3 are not correctly positioned. They are off one cell. For coloring I use a subroutine for formatting the cells. I cannot find the mistake in my code.

  • 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-23T13:52:49+00:00Added an answer on May 23, 2026 at 1:52 pm

    Found the problem. My Select case statements were incorrect. It has to be:

    For x = 1 To (Phase2duration + Phase3duration - 1) / 3
                Phase2range = Phase1CellLast() + Columncounter * 3
                Select Case Phase2range
    
                    Case Is < Phase2CellLast():
                      Call SetFontAndBackground(cells(Rowindex, Phase1CellLast() + Columncounter * 3), cells(Rowindex, Phase1CellLast() + Columncounter * 3), False, False, "", 10, False, "b", "lcyan", False)
                        Columncounter = Columncounter + 4
                    Case Is > Phase2CellLast():
                        Call SetFontAndBackground(cells(Rowindex, Phase1CellLast() + Columncounter * 3 + 1), cells(Rowindex, Phase1CellLast() + Columncounter * 3 + 1), False, False, "", 10, False, "b", "lcyan", False)
                        Columncounter = Columncounter + 4
                End Select
    Next x
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.