My problem:
I have a large excel sheet containing responses from on online survey. The online survey system exports in mainly string form with each answer being in its own column.
I already have an SPSS data input set up with particular variables which already has entries. So I am unable to make SPSS variables match Excel.
Once solution I have is to write a macro for each individual replacement, approx 200 different options available.
Is there another more efficient option?
I have a large excel sheet containing responses from on online survey. The online survey system exports in mainly string form with each answer being in its own column.
I already have an SPSS data input set up with particular variables which already has entries. So I am unable to make SPSS variables match Excel.
Once solution I have is to write a macro for each individual replacement, approx 200 different options available.
Code:
Sub rep()
Dim rng As Range
Set rng = Worksheets("sheet1").Range("B2:B1000")
Set rng1 = Worksheets("sheet1").Range("C2:C1000")
rng.Replace What:="Yes", Replacement:="1", Lookat:=xlWhole
rng.Replace What:="No", Replacement:="2", Lookat:=xlWhole
rng1.replace what:="Yes", Replacement:="1", Lookat:=xlWhole
rng1.Replace What:="No", Replacement:="2", Lookat:=xlWhole
End Sub
Is there another more efficient option?