Home |
Search |
Today's Posts |
#28
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok, I'll do that
keiji kounoike wrote: Ignore my comment about "Application.EnableEvents = False". In this case this doesn't have nothing with slowness. Sorry about misinformation. keiji keiji kounoike wrote: Inserting a new row invokes SheetChange event, so it takes some time to loop all cells in Target range. But it's strange for me this would take so long time as you said. Besides in my thought, It seems the line "For Each R In Target" is useless in your case and the code "Application.EnableEvents = False" will stop to go into this series of SheetChange event. Keiji Pierre62 wrote: Hello Rick, I understand what you mean but I don't think I need it. But I have another problem. When i.e. inserting a new row, it takes a lot of time before it happens. It seems the macro is working the whole sheet updating the symbols, or something else. Is it possible to limit the size of a worksheet to let's say 100 columns and 500 rows? I am starting to feel guilty asking things everytime.... Kind regards from Pierre "Rick Rothstein" wrote: I use your latest macro from 23-03-2009. Changing this macro to what it is now, does it mean you might want to change something in the other one, the non-macro? I don't think so. The macro visited each cell in each worksheet and (at first) changed all text to black (actually, Automatic) before applying the colors to those characters needing the change. The event code (what you are calling "the non-macro") only applies the color to the symbols in the actual cell being edited. Now, I might have to change the code for you IF you ever have a mixture of existing, pre-colored non-symbol text together with your symbols and you choose to edit only part of that text. The reason I would have to change the code in that circumstance is because the event code changes all the existing text in the cell to black (Automatic) before applying the symbol coloring... so if you had existing colored non-symbol text in the cell, it would be made black (Automatic) and only the symbols would be colored. Do you, or would you ever, have such a situation? -- Rick (MVP - Excel) "Pierre62" wrote in message ... Hello Rick, one more question.... I use your latest macro from 23-03-2009. Changing this macro to what it is now, does it mean you might want to change something in the other one, the non-macro? Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Dim X As Long Dim R As Range For Each R In Target R.Characters.Font.ColorIndex = xlColorIndexAutomatic For X = 1 To Len(R.Value) Select Case AscW(Mid(R.Value, X, 1)) Case 9824 'Spade symbol R.Characters(X, 1).Font.ColorIndex = 23 Case 9827 'Club symbol R.Characters(X, 1).Font.ColorIndex = 10 Case 9829 'Heart symbol R.Characters(X, 1).Font.ColorIndex = 3 Case 9830 'Diamond symbol R.Characters(X, 1).Font.ColorIndex = 45 End Select If X 1 Then 'SA text If Mid(R.Value, X - 1, 2) = "SA" Then R.Characters(X - 1, 2).Font.ColorIndex = 7 End If End If Next Next End Sub As you can see I changed the colors and NT is SA. Kind regards, Pierre |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting Conditional Formatting Icon Sets | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
Protect Cell Formatting including Conditional Formatting | Excel Discussion (Misc queries) | |||
conditional Formatting based on cell formatting | Excel Worksheet Functions | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions |