Hi
I've got two quick questions for which your help would be appreciated, if you've experienced this before:
i) I recorded a macro which selects data in a column and converts it to numbers (from text).
Each cell had the green triangle in the top right hand side saying 'Number stored as text'). However, although the text was converted to numbers, the macro doesn't work if it's re-run. Does anyone know why? It seems as though the record option didn't record what happened when the 'convert to number' action was done? The code is below.
ii) I've recorded a separate macro which also has the text conversion at the beginning (which isnt working) but then uses an index match to get a friendly name for some data. However, I'd like to amend the part of the code that fills the formula to fill it down to the end of the range (this is the part of the code below that I'm talking about
Selection.AutoFill Destination:=Range("E5:E168")
Range("E5:E168").Select
At present, it only goes far as row 168
Sub get_name()
Range("C5").Select
Range(Selection, Selection.End(xlDown)).Select
Sheet4.Select
Sheet10.Visible = True
Sheet4.Select
Range("E5").Select
ActiveCell.FormulaR1C1 = _
"=INDEX('Nominations Data'!C[2],MATCH('Review Tab'!RC[-2],'Nominations Data'!C,0))"
Range("E5").Select
Selection.AutoFill Destination:=Range("E5:E168")
Range("E5:E168").Select
Columns("F:G").Select
Selection.Delete Shift:=xlToLeft
End Sub
I've got two quick questions for which your help would be appreciated, if you've experienced this before:
i) I recorded a macro which selects data in a column and converts it to numbers (from text).
Each cell had the green triangle in the top right hand side saying 'Number stored as text'). However, although the text was converted to numbers, the macro doesn't work if it's re-run. Does anyone know why? It seems as though the record option didn't record what happened when the 'convert to number' action was done? The code is below.
Code:
Sub convert_text()
Range("C5").Select
Range(Selection, Selection.End(xlDown)).Select
End Sub
ii) I've recorded a separate macro which also has the text conversion at the beginning (which isnt working) but then uses an index match to get a friendly name for some data. However, I'd like to amend the part of the code that fills the formula to fill it down to the end of the range (this is the part of the code below that I'm talking about
Selection.AutoFill Destination:=Range("E5:E168")
Range("E5:E168").Select
At present, it only goes far as row 168
Sub get_name()
Range("C5").Select
Range(Selection, Selection.End(xlDown)).Select
Sheet4.Select
Sheet10.Visible = True
Sheet4.Select
Range("E5").Select
ActiveCell.FormulaR1C1 = _
"=INDEX('Nominations Data'!C[2],MATCH('Review Tab'!RC[-2],'Nominations Data'!C,0))"
Range("E5").Select
Selection.AutoFill Destination:=Range("E5:E168")
Range("E5:E168").Select
Columns("F:G").Select
Selection.Delete Shift:=xlToLeft
End Sub
Code: