Need help in highlighting the cell color in VBA

X

xllearner

Hi All,

I am new to the excel VBA. Your help is appreciated. Please Help me i
vba code for the following points.

I have attached the sample file of how i get and what changes woul
required once after i run macro in the excel.

1) Sum to column.
2) If city code numbers are same then highlight the cell backgaroun
color.
3) Merge the cell and highlight with the color.

Note: Data may vary. eg If today i am getting 100 tomorrrow it ma
1000.

Regards
Praveen.
 
S

Simon Lloyd

Why not record your actions and try to manipulate the code to loop
through the required number of cells. I looked at your file and do not
understand your logic for highlighting duplicate numbers as the numbers
you show you want highlighting are NOT the same?


Hi All,

I am new to the excel VBA. Your help is appreciated. Please Help me in
vba code for the following points.

I have attached the sample file of how i get and what changes would
required once after i run macro in the excel.

1) Sum to column.
2) If city code numbers are same then highlight the cell backgaround
color.
3) Merge the cell and highlight with the color.

Note: Data may vary. eg If today i am getting 100 tomorrrow it may
1000.

Regards
Praveen.


--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
 
X

xllearner

Why not record your actions and try to manipulate the code to loo
through the required number of cells. I looked at your file and do no
understand your logic for highlighting duplicate numbers as the number
you show you want highlighting are NOT the same?
DUPLICATE THREADS MERGED!



Simon, Thanks for your response.

I did tried recording the action that i want and it worked. However
recorded action cannot support the data when it vary. Say today, i ma
get 100 rows tomorrow it will be 150 or 250......1,000 , 2,000...
(cannot predict).

Highlighting dupicate numbers --- Actually the cells were highlighte
for four pairs. I have attached the new file please check. It is no
highlighted with the four different colors. (It is really not matter
much to me if it highlights with the same color for more than on
duplicate numbers when i run macro).

Apologies for the confusion.

Regards,
Praveen.


+-------------------------------------------------------------------+
|Filename: sample data.xls |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=622|
+-------------------------------------------------------------------+
 
E

Evolbob

Hi Praveen,

You shouldn't use merged cells.
I also don't see the need for any vba or blank rows.
It looks like this data is from a pivot table?

Anyway, have a look at the attached file which I hope will help.


+-------------------------------------------------------------------+
|Filename: sample data2.xls |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=623|
+-------------------------------------------------------------------+
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top