wintermaul
New Member
- Joined
- Apr 25, 2012
- Messages
- 4
Hi!
Ive have completed a survey in Forms wich asked for how satisfied you are with multiple things. I used words to describe answers instead of numbers when asking, and now im having trouble getting this into a good presentation.
So basically i need something to help me out to replace certain text with numbers in a marked row. The rows are not identical so i need to do this 1 row at a time.
I looked up and found a macro similar to what need here: How to create a macro code to achieve find and replace text in Excel?
Because its a loooong time since ive been into this VBA and excel in general i was hoping for some help from you. How can i get this macro to do 1 row at a time and not the entire sheet?
As a sidenote, ive also looked at the Find and Replace-function that searched for text to replace but it also searched the whole workbook.
Ive have completed a survey in Forms wich asked for how satisfied you are with multiple things. I used words to describe answers instead of numbers when asking, and now im having trouble getting this into a good presentation.
So basically i need something to help me out to replace certain text with numbers in a marked row. The rows are not identical so i need to do this 1 row at a time.
I looked up and found a macro similar to what need here: How to create a macro code to achieve find and replace text in Excel?
VBA Code:
Sub FindandReplaceText()
'Update by Extendoffice 2018/5/24
Dim xFind As String
Dim xRep As String
Dim xRg As Range
On Error Resume Next
Set xRg =Cells
xFind = Application.InputBox("word to search:", "Kutools for Excel", , , , , 2)
xRep = Application.InputBox("word to replace:", "Kutools for Excel", , , , , 2)
If xFind = "False" Or xRep = "False" Then Exit Sub
xRg.Replace xFind, xRep, xlPart, xlByRows, False, False, False, False
End Sub
As a sidenote, ive also looked at the Find and Replace-function that searched for text to replace but it also searched the whole workbook.