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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:25:44+00:00 2026-05-27T13:25:44+00:00

I am working on a section of a fairly large VBA macro that is

  • 0

I am working on a section of a fairly large VBA macro that is designed to apply conditional formatting when another cell is equal to 1, so that the cell can be highlighted as ‘selected.’
When generating the conditional formatting formula that does this, excel seems to be changing constant values of its own accord – all the values it reads from should be at row 99 and this is in the code, but excel instead changes the formula to =IF(B101=1,1,0) for the first one, then =IF(B105=1,1,0) for the next one and so on.
These are merged cells, so I would assume that excel is trying to autocomplete my code by offsetting the formula by how many rows down I am. Obviously this is not desired, does anyone know how I can stop excel from doing this? The relevant section of code is below:

    For Each x In Range(crange)
            condrow = 99
            Range(Cells(coffset + 3, y + 1), Cells(coffset + 2 + currentdiv, y + 1)).FormatConditions.Delete
            Cells(coffset + 3, y + 1).Value = x
            selectform = "=IF(" & ConvertToLetter(Cells(coffset + 3, y + 1).Column) & CStr(condrow) & "=1,1,0)"
            Range(Cells(coffset + 3, y + 1), Cells(coffset + 2 + currentdiv, y + 1)).Merge
        Range(Cells(coffset + 3, y + 1), Cells(coffset + 2 + currentdiv, y + 1)).FormatConditions.Delete
        Range(Cells(coffset + 3, y + 1), Cells(coffset + 2 + currentdiv, y + 1)).FormatConditions.Add Type:=xlExpression, Formula1:= _
            "clashform"
  • 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-27T13:25:45+00:00Added an answer on May 27, 2026 at 1:25 pm

    I believe you need to prefix a row or column reference by a “$” to prevent Excel from automatically adjusting it for different rows or columns.

    For example, “B$101” will allow the column (B) to be adjusted as the formula moves to a different location, but not the row, which is preceeded by a “$”.

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

Sidebar

Related Questions

I am working with a silverlight app that has a fairly large appsettings section
i am working on a section of a project, that parses Logs from Postgres
I'm currently working on an admin section for a website. The admin can use
I'm working on the comments section for a site, where users can quote something
I'm currently working on a tool that has a tabbed section that toggles width
I'm working on a long string grabbed from a Session that uses § (Section
I am working on a site with a fairly large accordion style navigation (it
I am working on a script that has become fairly convoluted. I suspect there
I am working an a section of application which needs to Parse CSV Logs
I'm currently working on the admin section of a Wordpress plugin and I need

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.