Good-day.
I have 2 columns of data (D, E), each with multiple rows of data in (number of rows changes depending on task):
1st column (D) = base term (blue widgets)
2nd column (E) = Exact, Phrase or Broad (can you tell what I do for living!?)
I need something that copies the value in column D, pastes it into column F and then wraps it accordingly where:
column E=Exact -> Square Brackets (i.e [blue widgets])
column E=Phrase -> Quotation Marks (i.e. "blue widgets")
column E=Broad -> nothing (i.e. blue widgets)
Have so far used:
Sub CellQuotes()
Dim cell As Range
For Each cell In Range("E20:E1048576").Cells
If cell.Value = "Exact" Then
cell.Value = Chr(91) & cell.Value & Chr(93)
End If
If cell.Value = "Phrase" Then
cell.Value = Chr(34) & cell.Value & Chr(34)
End If
Next
End Sub
but this wraps (correctly) the values in column D, rather than copy, paste then wrap in column F.
Using VBA because of the special characters ("), but first time trying to get to grips with it.
As you will have noticed, I'm also trying to run this over all rows with data - feel sure there's a better way to do this than just maxing the row range as above.
virtual pint for anyone who can help!
C
I have 2 columns of data (D, E), each with multiple rows of data in (number of rows changes depending on task):
1st column (D) = base term (blue widgets)
2nd column (E) = Exact, Phrase or Broad (can you tell what I do for living!?)
I need something that copies the value in column D, pastes it into column F and then wraps it accordingly where:
column E=Exact -> Square Brackets (i.e [blue widgets])
column E=Phrase -> Quotation Marks (i.e. "blue widgets")
column E=Broad -> nothing (i.e. blue widgets)
Have so far used:
Sub CellQuotes()
Dim cell As Range
For Each cell In Range("E20:E1048576").Cells
If cell.Value = "Exact" Then
cell.Value = Chr(91) & cell.Value & Chr(93)
End If
If cell.Value = "Phrase" Then
cell.Value = Chr(34) & cell.Value & Chr(34)
End If
Next
End Sub
but this wraps (correctly) the values in column D, rather than copy, paste then wrap in column F.
Using VBA because of the special characters ("), but first time trying to get to grips with it.
As you will have noticed, I'm also trying to run this over all rows with data - feel sure there's a better way to do this than just maxing the row range as above.
virtual pint for anyone who can help!
C