Asterix
01-06-2008, 01:53 AM
Spreadsheet is a simple table, each row is a record, each column cell within each row is a field for that record.
I've applied a named range to each column (e.g. A:A = "Event", B:B is "Name_class", M:M is "Novice_or_expert").
I'm trying to loop through the non-blank records from row 2 onwards (row 1 is a header) and apply a value to each "Novice_or_expert" field based on using name_class as a vlookup into another sheet.
Code so far is...
For Each c In Range("name_class")
If c.Value <> "" And c.Value <> "Name & WSCC class" Then
If novice_or_expert.Value = "" Then novice_or_expert.Value = Application.WorksheetFunction.VLookup(c.Value, Worksheets("Lookup data - input").Range("B:E"), 4, False)
End If
Next
...but that doesn't work (and I know that it's because the novice_or_expert.value reference is fundamentally wrong). Problem is, not sure how to put this simple problem right. Have been searching but can't find solution.
Any help gratefully received.
I've applied a named range to each column (e.g. A:A = "Event", B:B is "Name_class", M:M is "Novice_or_expert").
I'm trying to loop through the non-blank records from row 2 onwards (row 1 is a header) and apply a value to each "Novice_or_expert" field based on using name_class as a vlookup into another sheet.
Code so far is...
For Each c In Range("name_class")
If c.Value <> "" And c.Value <> "Name & WSCC class" Then
If novice_or_expert.Value = "" Then novice_or_expert.Value = Application.WorksheetFunction.VLookup(c.Value, Worksheets("Lookup data - input").Range("B:E"), 4, False)
End If
Next
...but that doesn't work (and I know that it's because the novice_or_expert.value reference is fundamentally wrong). Problem is, not sure how to put this simple problem right. Have been searching but can't find solution.
Any help gratefully received.