2 in 1: Conditional formatting and Data reorganization.

Neck_Deep

New Member
Joined
Jun 22, 2013
Messages
2
From reading the form I have to admit I'm a little shy to ask these two questions and not feel a little... well, Dumb.

First Question: I have a set of data with column headers from A through XX. The data in each row has information about specific events over a large time frame. This data can be up to 4000 to 5000 rows of data. Specifically, I want to format the entire row if a value of greater than zero appears in the row within column T. I typically would go to the conditional formatting tab and create rule like =indirect("T"&ROW()) then establish the font color and font style. Once I apply to the entire sheet, everything looks great.

I'm using Excel 2007 and when I try to record this with the Macro record function I fail. It just doesn't work. Any thoughts?

Second question: while this set of data isn't nearly as long, I still struggle to visualize what the code would look like. Headers across the top contain column headers like client ID, name, address, and so on. I want to organize this info so that if multiple client names appear under the same client ID number it will pull the client data into a organized format down the left with the client ID in column A and column B has the names associated with the address, phone and so on underneath. Almost like a pivot table, but without the horizontal length you tend to get when you start adding lots of column values. My client data can have as much as 32 to 40 columns of information. This makes it hard when reading the data because you have to scroll to the right. Thoughts?

ti know I'm asking a lot and not providing screenshots and whatnot, but any thoughts would help. Which function would be best. Thank you.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi and welcome to MrExcel.

**I do not write or understand VBA, so I cannot help you further with coding, sorry.**

First Question.

I have recorded the following macro (which can be trimmed down, by an expert) to highlight the complete row based on the value in column T being greater than 0.

Code:
Sub TestCF()
    Range("A2").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T2>0"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 65535
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Range("A2").Select
End Sub

Results when macro has run....

Excel Workbook
ABCSTUVW
1Data1Data2Data3Data19Data20Data21Data22
2BillTim1Cat1BikeSun
3BobSam1Dog0BusMoon
4BenSue1Pig2TramStar
5BudDan2Cow0TaxiRain
6TedDen1Rat0TrainSnow
7TomDon1Duck3PlaneHail
8
Sheet3


Second question.

Other than applying Filters, Freeze Frame and Sorting your data based on Client ID, I have no idea how you can achieve what you require.

I'm sorry that I couldn't be of more/better help to you, but I'm sure someone will jump in with their take on your situation.

Ak
 
Upvote 0
Hi and welcome to MrExcel.

**I do not write or understand VBA, so I cannot help you further with coding, sorry.**

First Question.

I have recorded the following macro (which can be trimmed down, by an expert) to highlight the complete row based on the value in column T being greater than 0.

Code:
Sub TestCF()
    Range("A2").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$T2>0"
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 65535
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Range("A2").Select
End Sub

Results when macro has run....

Sheet3

*ABCSTUVW
1Data1Data2Data3Data19Data20Data21Data22*
2BillTim1Cat1BikeSun*
3BobSam1Dog0BusMoon*
4BenSue1Pig2TramStar*
5BudDan2Cow0TaxiRain*
6TedDen1Rat0TrainSnow*
7TomDon1Duck3PlaneHail*
8********

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:42px;"><col style="width:42px;"><col style="width:42px;"><col style="width:49px;"><col style="width:49px;"><col style="width:49px;"><col style="width:49px;"><col style="width:30px;"></colgroup><tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Second question.

Other than applying Filters, Freeze Frame and Sorting your data based on Client ID, I have no idea how you can achieve what you require.

I'm sorry that I couldn't be of more/better help to you, but I'm sure someone will jump in with their take on your situation.

Ak

AK,

thank you. I'll insert this in my larger Code and based on what you wrote I think it should work. Thanks again for the help.
 
Upvote 0
Hi,

You can delete the quoted text that automatically gets added when you post a reply!

If you need additional help with the VBA code, then I suggest that you start a new post with a title like "VBA Conditional Formatting code needs editing".

Good luck with your project and thanks for your feedback. :biggrin:

Ak
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,545
Members
449,317
Latest member
chingiloum

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