Find same value and Changing a cell & tex color WITHOUT using Conditional Formatting

Dsunil05

New Member
Joined
Feb 20, 2015
Messages
34
Office Version
  1. 2021
  2. 2019
  3. 2013
  4. 2007
  5. 2003 or older
Platform
  1. Windows
12
1921
252931
3233343637394450535566747577
0813161822233139454752596470717273747779
.
.
.
.
.
.
.
.
.
.
.
.
.
0309101113181927353744505759657072767980
0205111417283233373842475963647173747778
03
06080913212430313638424954596570727579

<tbody>
</tbody>

data range A1:T27
i want to find out same number And change their "cell color and text color" in data range A1:T26 of row no 27's 20 number in pink colour.
Without using Conditional Formatting
Because i copy it and use it to another data set in same worksheet e.g. range U1:AO27
In MS Excel 2007
Thanks
 
still not working
Strange since the code I posted works fine for me whether the numbers are all text value or real numbers. Do you by any chance have some kind of mixture of real numbers and text numbers? Any chance you can post a copy of your workbook to DropBox or some other such file sharing facility so that we can watch our codes run directly against your actual data?
 
Upvote 0

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.
still not working

how post the screen shot of my manual work


21687976_1711033845587229_8428108761949864959_n.jpg
 
Last edited:
Upvote 0
Sub MatchNumbersCopyFormats()
Dim C As Long
Application.ReplaceFormat.Clear
For C = 1 To 20
Application.ReplaceFormat.Interior.Color = Cells(27, C).Interior.Color
Application.ReplaceFormat.Font.Color = Cells(27, C).Font.Color
Range("A1:T26").Replace Cells(27, C), "", xlWhole, SearchFormat:=False, ReplaceFormat:=True
Next
Application.ReplaceFormat.Clear
End Sub

It's working very well.

In what way it is not working???? Explain!!!
Post a copy of your workbook NOT a pictures, to DropBox or some other file sharing.
 
Last edited:
Upvote 0
That is a picture... I meant a real Excel workbook that was a copy of your physical workbook. I can open a real workbook but I cannot do anything with a picture except look at it. You cannot post a real Excel workbook here which is why I suggested upload it to DropBox or some other file sharing facility.
 
Upvote 0
That is a picture... I meant a real Excel workbook that was a copy of your physical workbook. I can open a real workbook but I cannot do anything with a picture except look at it. You cannot post a real Excel workbook here which is why I suggested upload it to DropBox or some other file sharing facility.


https://drive.google.com/file/d/0B1u8QGSQIxdoeXRvRHd2THVaenM/view?usp=sharing



step by step what i am doing for duplicate manualy

1. create table
2. then enter numbers in cells
3. then right click on selected range A1:T27
4. click on format cells
5. in number tab select custom catagory
6. then in "type" text box enter "00" for convert any single number come with double e.g. 1 = 01
7. find duplicate one by one manualy
 
Upvote 0
https://drive.google.com/file/d/0B1u8QGSQIxdoeXRvRHd2THVaenM/view?usp=sharing

step by step what i am doing for duplicate manualy

1. create table
2. then enter numbers in cells
3. then right click on selected range A1:T27
4. click on format cells
5. in number tab select custom catagory
6. then in "type" text box enter "00" for convert any single number come with double e.g. 1 = 01
7. find duplicate one by one manualy
I am not sure what #7 means, but when I remove the background color and font color for cells A1:T26 and then run my macro, the colors are all reestablished correctly, so when you say my code is not working, I don't know what you mean. You are going to have to tell us in detail how it is not working for you. What is it doing that you do not want to happen? Or, said another way, what is it you expect to happen that isn't happening.
 
Upvote 0
I am not sure what #7 means, but when I remove the background color and font color for cells A1:T26 and then run my macro, the colors are all reestablished correctly, so when you say my code is not working, I don't know what you mean. You are going to have to tell us in detail how it is not working for you. What is it doing that you do not want to happen? Or, said another way, what is it you expect to happen that isn't happening.

#7 it means

look at A27 number and find them manually and select in every row by holding ctrl key then change its font color, style "bold" and cell color also

repeat this for every number of row 27

your code not working means

when run the macro there is no change in font color or cell color
of A1:T26 And A27:T27

it is viewing normal
 
Last edited:
Upvote 0
so sorry it was my mistake
that before run the macro not change color of cell,font and style of A27:T27
that's why it is not showing result
right
but it is not doing automatically every time do change color of cell,font and style of range e.g.A27:T27

can i repeat this or copy and past it and use it to another data set in same worksheet e.g. range V1:AO27 to XEK1:XFD27 different number of sets
 
Last edited:
Upvote 0
Edit: The response below was before I had seen post #19 . I'm not sure if that changes anything

Try this
Code:
Sub MarkMatches_v2()
  Dim a As Variant
  
  Application.ScreenUpdating = False
  With Range("A1:T27")
    a = .Value
    .Font.Bold = True
    .Value = Evaluate(Replace("if(row(#),match(#," & Range("A27:T27").Address(1, 1) & ",0),"""")", "#", .Address))
    With .SpecialCells(xlConstants, xlNumbers)
      .Font.Color = 11851260
      .Interior.Color = 411543
    End With
    .Value = a
  End With
  Application.ScreenUpdating = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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