How do I tell excel to only color certain cells in vba

gloworm

New Member
Joined
Jul 12, 2011
Messages
7
I am new to vb and sure could use some help on doing a couple of things.

1 - I have various columns that i need to color code, depending on what is in the cells.

ex: I would sort column j smallest to largest. Then anything under 100 gets made bold and colored red. If it is over 100 then it is bold and green.


2 - I would also like to add a column to the file and then take the first two numbers from the adjacent column and have them be in the newly created column.

ex: insert new column b. Column c has 3 numbers in it, 46000, 56000, 66000. I want to have 46,56,or 66 populate new column b.

This data comes from a query run via a macro in access. It would be handy if I could get excel to run the macro in access, open the file in excel, that is created by the macro. Then do all of this sorting and formatting.

Like I said, I am new. I did some of this a few years ago, but I have forgotten all that I knew.

An issue I am having in trying to get excel to open the database and run the macro, is that the database has a security file, .mdw that it references in order to open. I placed the shortcut location, including a path to the security file, and the username and password. It then gives me a error on the security file path in the code. Error code is like 2486 or something. I did some looking around and found TONS of possibilities as to what is causing the error.

The shortcut I created to open the database and log me into it is as follows:

"C:\Program Files\Microsoft Office\Office14\MSACCESS.EXE" "C:\Users\Gloworm\Desktop\F\QCV2011C.mdb" /wrkgrp "C:\Users\Gloworm\Desktop\F\QCSecurity.mdw" /User "" /pwd ""

When I tell vb that I want to open that file referenced in the shortcut, it doesn't like the part from /wrkgrp on.

Any help is appreciated.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,224,595
Messages
6,179,799
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top