-
• #152
Excel 2010 Conditional formatting..
I'm having a mind blank.
Can I Use this to highlight a whole row rather than just the cell containing value required? -
• #153
Yes, conditional formatting works best over a range
-
• #154
The part I'm blanking on is how to set it to highlight the row rather than a single cell.
A2 has the text but I can only highlight that automatically rather than Row A etc -
• #155
It doesn't really work like that. It is designed to illustrate the distribution of data across a range.
-
• #156
I stand corrected!
-
• #157
Thanks guys,
Ended up doing it but cell, sort by cell colour , fill repeat.
But in the future I'll try your way Tiswas as this is going to be a new regular report. -
• #158
Ive got some rows of data, most of which have information in. For each row I want to create a list of all the cells that are blank (ie their column header). I have managed to find the position of the first blank cell using [FONT=Arial][SIZE=2]=MATCH(TRUE,INDEX(V3:CA3="",0),0) but not sure how to make this find each other cell after that and make a list of it.
[/SIZE][/FONT] -
• #159
This will be quite cumbersome to achieve in Excel, as you will need to explicitly check each cell in turn and append its location to a string. However, it's pretty straightforward with a few lines of VBA.
This (pretty poor) code makes a list in column A of each blank cell (by column number) in the row (from col B to col U) for rows 1-28. Should be pretty easy to modify
[code]
Sub thingy()
For i = 1 To 28
myStr = ""
For Each c In Range("B" & i & ":U" & i)If c = "" Then myStr = myStr & ", " & c.Column
Next
Range("A" & i).Value = myStr
Next iEnd Sub
[/code] -
• #160
This will be quite cumbersome to achieve in Excel, as you will need to explicitly check each cell in turn and append its location to a string. However, it's pretty straightforward with a few lines of VBA.
This (pretty poor) code makes a list in column A of each blank cell (by column number) in the row (from col B to col U) for rows 1-28. Should be pretty easy to modify
[code]
Sub thingy()
For i = 1 To 28
myStr = ""
For Each c In Range("B" & i & ":U" & i)If c = "" Then myStr = myStr & ", " & c.Column
Next
Range("A" & i).Value = myStr
Next iEnd Sub
[/code]Cheers, I think this is exactly what I want.
-
• #161
Alright im fairly new to VB, ive got the code changed to report column title, but can I get it to repeat untill the last cell, rather than enter the i min/max values?
-
• #162
Also, ive got a list of individual names from a larger set of data, how can I get Excel to produce lists of all data from the larger data set grouped under the individual names?
I basically want to do a VLOOKUP that returns multiple values relating to it
-
• #163
I don't fully understand your last problem, but iI understand that you're asking for vlookup to return a number of cloumns? so in the following table:
age height weight
chris 23 175 10
simon 24 180 10.5
tim 25 185 11you'd want a 'vlookup' of simon to return 24,180,10.5
Is that correct? In that case, you may be better off adding another column to the table which is a concatenate of all the previous ones and asking for that from the vlookup.
Your data then becomes:
age height weight return value
chris 23 175 10 23,175,10
simon 24 180 10.5 24,180,10.5
tim 25 185 11 25,185,11Does that make sense? You may need to write a little function to concatenate the data (i.e. produce the 'return value' column) to your own specification, and Mattty's code above looks like a sensible place to start for that
-
• #164
.
-
• #165
edit: sorted
[code]
Sub OperatorProp()For i = 3 To 500
For j = 3 To 1727 If Cells(j, "C") = Cells(i, "H") Then myStr = myStr & Cells(j, "B") & ", " End If
Next j
Range("I" & i).Value = myStr
myStr = ""
Next iEnd Sub
[/code]But is there a way to get the code to keep going until the end of the list without entering in the first and last value of the for loop?
-
• #166
ok, try this:
Public Function getAgeGroupList(age As Long, table As Range) As String
Dim i As Variant
Dim tableVar As VariantDim returnValue As String
Dim delimiter As Stringdelimiter = " | "
tableVar = table
For i = 1 To UBound(tableVar)
If (tableVar(i, 2) = age) Then
returnValue = returnValue & tableVar(i, 1) & delimiter
End If
Next igetAgeGroupList = returnValue
End Functiongive it a range of name | age columns (as your example) and a number of the age:
eg:
age group
20 Tom | Harry | Simon |
21 Dick | Chris |
22
23 Tim |where the group column holds
=getAgeGrouplist(F9, B2:C7)
(B2:C7 holds your name | age data, F9 has the number 20, 21, 22 or 23)
Hope that makes sense
-
• #167
How can I get Visual Basic to enter:
Tube: Bayswater
Into a cell? I think its having problems with the characters, ive used " " on each side but its still giving an error.
-
• #168
[code]
"
range("a1").value = "Tube: Bayswater
[/code]should work
it enters it in cell A1 on the worksheet currently active -
• #169
Ok, what about this?
mystr = mystr & "<a href="http://www.ncp.co.uk/find-a-car-park.htm?t=link&q=""
It seems to be having issues with the "" inside another ""
-
• #170
Yes, the syntax is to use double " when they appear in a string, so:
[code]
mystr = mystr & "<a href=""http://www.ncp.co.uk/find-a-car-park.htm?t=link&q="""
[/code] -
• #171
Morning.
Yesterday I wrote a simple formatting macro and then was happily able to copy it and edit it to make new versions (for different filtering/sorting) for different tabs in the same workbook.
This morning I've gone to do the same but now can't edit or copy etc - all the buttons are greyed out apart from 'run' and 'stepinto'.
Why, oh, why???
I need to use the same macro for a number of tabs, but with slightly different filters, so don't really want to re-write it each time.
Any ideas?
-
• #172
Sounds like you've not enabled the macro content when you opened the file? Go to security centre and sort it bro.
-
• #173
aha.
I had enabled it all, but hadn't closed then re-opened the sheet.
All is now well in the world.
Ta! -
• #174
Excel experts, I need some help.
I have a column (let's call it A) and in that column not all the rows have values. Is there a formula that will automatically put a value in the adjacent column (B) whenever there is a value (any value) in A? Like a full stop or comma for instance.
Data merges. Do not want.
-
• #175
Tiswas, that is exactly what I needed. Thank you! Blowing kisses your direction right now.
Nah I'm using SUMIFS and it needs to scale. Ended up re-writing some of the SQL to change the structure a little. Cost me about half a day's work though.