Hi Guys
I have come across the below code that will work to some extent but am trying to add a loop that will return it to the beginning so that x number of numbers can be changed. on each sub routine
Sub VLANChanger()
Dim userfind As String
Dim userchange As String
'add colums old vlans to end ready for chnage
Columns("D:E").Select
Selection.Copy
Columns("L:M").Select
ActiveSheet.Paste
Range("L1").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "New VLAN"
Range("M1").Select
ActiveCell.FormulaR1C1 = "New Voice VLAN"
Range("L1").Select
Set R = Range("L:L") '<--set your range here

userfind = InputBox(Prompt:="Do you want to Change Any VLAN Numbers.", Title:="Change VLANS", Default:="Enter Old VLAN Number Here")
If userfind = "defaultvalue" Or userfind = vbNullString Then
MsgBox ("You need to enter something")
Exit Sub
End If

R.Select

Dim foundRange As Range
Set foundRange = Selection.Find(What:=userfind)
If foundRange Is Nothing Then
MsgBox ("No such value exists")
Exit Sub
End If


userchange = InputBox(Prompt:="What is the New VLAN Number", Title:="New VLAN?", Default:=userfind)
If userchange = "defaultvalue" Or userchange = vbNullString Then
MsgBox ("You need to enter something")
Exit Sub
Else

For Each cell In R
If cell.Value = userfind Then
cell.Value = userchange


End If
Next
End If
End Sub
then it runs
Sub VoiceVLANChanger()
Dim userfind As String
Dim userchange As String

Set R = Range("M:M") '<--set your range here

userfind = InputBox(Prompt:="Do you want to Change Any VoiceVLAN Numbers.", Title:="Change VoiceVLANS", Default:="Enter Old VoiceVLAN Number Here")
If userfind = "defaultvalue" Or userfind = vbNullString Then
MsgBox ("You need to enter something")
Exit Sub
End If

R.Select

Dim foundRange As Range
Set foundRange = Selection.Find(What:=userfind)
If foundRange Is Nothing Then
MsgBox ("No such value exists")
Exit Sub
End If


userchange = InputBox(Prompt:="What is the New VoiceVLAN Number", Title:="New VoiceVLAN?", Default:=userfind)
If userchange = "defaultvalue" Or userchange = vbNullString Then
MsgBox ("You need to enter something")
Exit Sub
Else

For Each cell In R
If cell.Value = userfind Then
cell.Value = userchange


End If
Next
End If
End Sub

This code does the trick but was not as 'simple' as I originally wanted it.
I currently use the following to run it against both columns
VoiceVLANChanger but as it only runs once per sub routine and i have x number of VLANS i want it to loop until the user does not enter anything and then it ends and the next sub routine run


Thanks n advance