Error On Highlighting First Cell When Row Is Sorted?
Dec 12, 2013
I am getting a debugging error when I try to highlight the first row of a column that is sorted. the error occurs on the "if .autofiltermode then" line. the code does highlighting like I want but is giving me a run time error.
HTML Code:
Private Sub Worksheet_Calculate()
ColorAutoFilter
End Sub
The code below seems perfectly fine to me, but for some reason, my range ends up being every row, even if the first cell is an error. Also I get a error on the line "Range(Rng).Select": Run-time error '1004': Method 'Range' of object'_Global' failed.
I found this spreadsheet on here and I have been trying to customize it to what I need. I am trying to have scores from skins match highlighted. I want only the minimum score to be highlighted but if there is another duplicate minimum score I don't want it to highlight anything. I also need to find a way to count the skins won by each player and have it off to the side.
For those not familiar with golf a Skin is a game where you try to get the lowest amount of strokes on a specific hole. Ex- 4 people play the hole one. P1 scores 4, P2 gets a 3, P3 and P4 get 6. The skin would go to P2 who has the lowest score on that hole.
Highlight lowest number in each column not highlighting if there are duplicates starting at L6 down to L11 and for each column till AC. And the same for the group just to the right on attached file.
On row 13 and 14 it tells me who won a skin. I want to tally up the total skins won by each player. so if Joe's names shows up twice on R14 I want it to tell me somewhere in the sheet Joe = 2
I am trying to reference a cell in sheet All Employees in sheet Brock. This is an employee training database.
Currently there is no data in the cell I want to reference (B9). When I use the formula ='all employees'!b9 the cell in the brock sheet shows "january 00 00" even when the referenced cell is empty. This problem is eliminated if I formate the Brock cell to General. It then displays a zero.
However, the cell in the All Employees Sheet is going to be a date. If I format the Brock cell to general, when I enter a date in All Employees, it gives a large number, not a date. This problem is eliminated by changing the formating of the Brock cell to Date.
What I would like to do is be able to type the date in the All Employees sheet and have it magically transfer to the Brock sheet without any additional work. I would like the brock sheet to be printable, and with January 00 00 written all over it, not only is it messy but its incorrect.
how to filter rows of data, in ascending or descending order, whilst still retaining formatting (in my case cell borders) and conditional formatting?
At present, when I filter rows in ascending / descending order, the cell formatting & conditional formatting stays in it's original position, rather than moving with the cell. I can't find a way to resolve this.
Column A is all random dates . When the date happens on the 1st I need to highlight that row. I'm pretty sure conditional formatting is the way I need to go but have had no luck. The date format is dd/mm/yy.
Was working away on one of my spreadsheets and the black square that surrounds the cell you click on has vanished. i.e. if you click on cell A1, you normally get a black square surrounding the cell A1 to let you know that you are on it. That black square has disappeared.
It seems to affect any spread that I open but if I open a new spreadsheet it is there.
I work with many sheets that have many data columns and have used a "greenbar" formula in conditional formating but would like to have a similar formula that highlights the current row. If possible, it would be nice if this new formula would not wipe out all other formatting as it moves.
I have seen Ivan's work at www.mrexcel.com/hof001.php but it says that it wipes out other formatting.
The formula that I am currently using is =MOD(ROW(),3)=2 Is there a way of getting the current row number so that it could be =ROW()=(current row number) ?
how to highlight a particular cell red if the value in one cell is less than or equal to the value in another cell. For instance, How do I make it so that the "Hours to go" cell turns red if the value in the "Actual Last Completion" value is less than or equal to the value of "Last Completed" cell?
I have built a spreadsheet for my business which has an annoying feature I can't get rid of. When I click in a cell I want to enter data in the spreadsheet automatically highlights that cell and the neighbouring cell. I have to move away then back with the arrow keys to get back to the single cell I want to enter data in.
I have a macro, and it mainly works, except the second part where it checks if the value is less than 7, and returns it to a white background.
The cell has a formula in it that returns "" based on another series of cells. I have considered changing that to a zero and formating, but for reasons that don't need explanation, i have chosen not to.
here is the macro. I need the second part to be activated if less than 7, as well as if the cell returns ""
I have a cover sheet to a workbook that holds hyperlinks to its relevent page. Several of the hyperlinks link to the same page but different relevant cells. However it is not overly clear which cell is active when you click the hyperlink. What I would like is for the active cell to be highlighted on the page. EG hyperlink 1 links to page 1 cell A2 & hyperlink 2 links to page 1 cell B6 - I would like A2 to be highlighted when accessed by hyperlink 1 & B6 highlighted when accessed by hyperlink 2.
Have a spreadsheet shows 4000 warehouse locations (location of products). Each cell is a location in the warehouse (ba050, ca809, etc, actual warehouse locations, not grid ref); some products have more than one location, the locations are always next to each other. I import a text file into the workbook which tells me which product has more than one location (2, 10, 50, etc), that’s all I’m interested in ( multiple locations).
What I’ve done so far is to use vlookup to look at locations in file and allocated the number (the number of locations that product has) next (next column) to the cell that correspond to that location. What I need is a macro or formula that will look at the number and than highlight that many cells up or down the column, according to the number in the cell to the right (5 in cell, highlight 5 cells, 50 highlights 50). The warehouse runs up one aisle and then down the next and so on. So I need to be able to highlight cells up one column and then down the next and then up, then down and so on.
Multiple locations change on a daily bases, so need a quick way of updating 4000 locations.
New to excel don’t know if this is possible or not. Learning as I go. Need some assistance.
Sample below. Only interested if a number is returned, “******” can be ignored as will hide all columns expect ones with locations. So:
BA020 returned value of 4, so would like to highlight (any colour) BA020, BA029, BA040, BA049.
BB780 returned value of 2, so would like to highlight BB780, BB789.
See attached work book, it is an mot booking system that is all working fine except for one thing that I don't know how to change.
At the moment if you double click a cell in the test type column it enters the required data and turns the cell green highlighting the length of time and values this is all good but I am wanting the ones that start with n-side to turn yellow just so that we can see our own internal tests easily. It is control in the coding not formatting . Is there a way this can be done?
I work for a marketing agency where technical savvy-ness is really limited. We analyze a lot of web page elements. I have a program that exports this data into a csv file and I've created a template for the user to add this sheet. This data is primarily text. I've created a button on another sheet that runs a macro that extracts data from the first sheet onto the second sheet in a particular format for ease of reading and editing it. That part is all good, this macro works and the button works. Now I'm trying to have it such when a person edits one of these cells, it highlights the changes on this newly sheet using VBA (the highlighting changes function just turned out to be too messy and buggy for what I want). I have this basic change macro that I have on the sheet currently:
Private Sub Worksheet_Change(ByVal Target As Range) Const WS_RANGE As String = "A1:H500"
On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target .Interior.ColorIndex = 30 End With End If
ws_exit: Application.EnableEvents = True End Sub
This works as well. However, my problem is that when I run the data button macro, of course excel reads this as a change to the cell and highlights it as a change before any actual changes are made. How can I have it so I run my data macro, and the cell changes are highlighted only *after* the user goes in to edit the text data plugged in from the data macro?
Is it possible to click on a cell in column C, and have the wishlist below happen:
That active cell's row is hightlighted.
Any cell in that column that has the same value as active cell is also highlighted.
Plus, any cell in another sheet that has that value it's row is highlighted too.
Example:
I click on C5 in Sheet 2 its value is 45000789 it row is highlighted, this value also appears in C3 in the same sheet, so it's row is highlighted as well. Plus, in sheet 1 in C10 this value appears and it's row is highlighted as well. When any of the values are clicked again the highlight is removed from all parties.
I am trying to create a VBA code that will automatically highlight the row of an Excel table (2007) of the active cell. So far I have this:
Code: If Not Intersect(ActiveCell, Range("Table_Name")) Is Nothing Then Range("A" & Target.Row & ":EJ" & Target.Row).Interior.Color = 10092543 End If
Where the columns A and EJ represent the size of the table. But I would like to automate the column choices so that if the table has columns added or removed, the code still works. Is there a way to just reference a row of a table?
I have a big spreadsheet that has 30 columns. The data is downloaded from an SQL database from time to time. The row identifying data ( the record number/key ) is in the left most cell. I often have to move over 10 to 20 columns to view some other data in the same row. I can do this by selecting the preset Excel row number which higlights the whole row and then use the lower slider bar to go to the correct column to view the data.
However if I wish to select an item of data ( or update a particular cell ) then I loose the highlighting for that row and I can "loose" which row I am on. ( maybe I'm stupid but it does happen ) Can I use Conditional formatting to highlight a row whenever I alight on any data in that row and it sttays highlighted until I select another value on another row?
I have a data set of about 600 records. I want to be able to extract the Top 10% of the records and get rid of the other 90% - the values can change over time, so I always want to start with the full 600 records.
I am aware of the conditional formatting function that will identify the Top 10%, but I was looking for VBA language (does not have to be VBA - just automated), that calculated the 10% subset and either moved it to a different sheet, OR deleted the bottom 90% - in either instance the result being just the list of the top 10% of the data set.
I have a list of entries on one sheet. This sheet contains part numbers in random order. I would like to draw out the part numbers onto a new sheet, with no repeats and in numerical order. I want this to be done automatically without using a sort command. Also, I would like to avoid VBA if possible.
I have an issue sorting values. i can get the numbers together and sorted, but want to keep a name associated with the values being sorted. so when the values are sorted, and they change the name associated with each value moves with it. Its acutally a first-tenth place in a nba fantasy league.
Does anyone know of an Excel object class that you can put objects into with a key and the process it in key-sorted order? If not, is there a library that I can reference to get such a thing?