From: xllearner on

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.


--
xllearner
------------------------------------------------------------------------
xllearner's Profile: http://www.thecodecage.com/forumz/member.php?u=1961
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=206560

http://www.thecodecage.com/forumz

From: Simon Lloyd on

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?


x
l
l
e
a
r
n
e
r
;
7
3
6
0
6
1

W
r
o
t
e
:


>
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)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?u=1
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=206560

http://www.thecodecage.com/forumz

From: xllearner on

Simon Lloyd;736123 Wrote:
>
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?
>
>
>

> 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 may
get 100 rows tomorrow it will be 150 or 250......1,000 , 2,000....
(cannot predict).

Highlighting dupicate numbers --- Actually the cells were highlighted
for four pairs. I have attached the new file please check. It is now
highlighted with the four different colors. (It is really not matters
much to me if it highlights with the same color for more than one
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|
+-------------------------------------------------------------------+

--
xllearner
------------------------------------------------------------------------
xllearner's Profile: http://www.thecodecage.com/forumz/member.php?u=1961
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=206560

http://www.thecodecage.com/forumz

From: Evolbob on

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|
+-------------------------------------------------------------------+

--
Evolbob
------------------------------------------------------------------------
Evolbob's Profile: http://www.thecodecage.com/forumz/member.php?u=1980
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=206560

http://www.thecodecage.com/forumz