VBA help

Upallnite

New Member
Joined
Apr 29, 2014
Messages
7
Hi,

I am trying to utilize VBA code in my spreadsheet. I do not know alot about it. Can someone explain the steps.

1. open workbook
2. ALT F11
3 paste code
4. ALT Q

now what? Do I now RUN the code? ALT F8? and then do I continue to enter my formula?

Senerio:

I have a column of numbers (A5-A434). Within that column I have several yellow cells. I want to add the sum of all the yellow cells in cell A435.

I have found a code on internet that will allow me to accomplish this task - however, I cannot seem to go any further than copy/paste code in module. When do I enter my formula? when do I run the VBA Code?

When I hit ALT F8 - its blank so when I go back to check to see if my code is there (ALT F11) - its there...
What am I missing??

Thanks for the help. Here is the link to the code I want to use How to count by color and sum by color in Excel 2010 and 2013

I am using excel 2010
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi, and welcome to the forum!

The code you paste in to a module provides you with some extra worksheet functions that are not part of the regular Excel ones. They are called UDFs or User Defined Functions. You don't have to run that macro code explicitly, just paste it in and save the module.

You can now go to the worksheet with your data and enter your formulas using the new functions (e.g. =SumCellsByColor(A5:A434,A1) ). You will also need to know the code for the colour. Use the GetCellColor function to help you. In my example above, I assumed that the code for yellow was in cell A1.
 
Upvote 0
Hi, and welcome to the forum!

The code you paste in to a module provides you with some extra worksheet functions that are not part of the regular Excel ones. They are called UDFs or User Defined Functions. You don't have to run that macro code explicitly, just paste it in and save the module.

You can now go to the worksheet with your data and enter your formulas using the new functions (e.g. =SumCellsByColor(A5:A434,A1) ). You will also need to know the code for the colour. Use the GetCellColor function to help you. In my example above, I assumed that the code for yellow was in cell A1.

Thank you so much for the explanation. I got it to work...
take Care
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

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