I
InventoryQueryGuy
I just can't get the code to work. I either get a syntax error or error '53'.
Can anyone see where i'm going wrong here. My goal is to rename a file based
on one cell matching another.
Option Compare Text
Sub CribSortingTest()
Dim s1, s2 As String
Dim x, y As Integer
x = 2
y = 1
Do While Workbooks("NewCrib copy.xls").Worksheets("Sheet1").Cells(x,
1).Value <> ""
s1 = Cells(x, 3).Value
s2 = Cells(x, 4).Value
If Workbooks("NewCrib copy.xls").Worksheets("Sheet1").Cells(x, 4).Value <>
"" Then
Name "D:\Documents and Settings\e345193\Desktop\Tools\" & s2 & ".doc" As
"D:\Documents and Settings\e345193\Desktop\Tools\New TCs\" & s1 & ".doc"
Else
End If
x = x + 1
s1 = ""
s2 = ""
Loop
End Sub
Can anyone see where i'm going wrong here. My goal is to rename a file based
on one cell matching another.
Option Compare Text
Sub CribSortingTest()
Dim s1, s2 As String
Dim x, y As Integer
x = 2
y = 1
Do While Workbooks("NewCrib copy.xls").Worksheets("Sheet1").Cells(x,
1).Value <> ""
s1 = Cells(x, 3).Value
s2 = Cells(x, 4).Value
If Workbooks("NewCrib copy.xls").Worksheets("Sheet1").Cells(x, 4).Value <>
"" Then
Name "D:\Documents and Settings\e345193\Desktop\Tools\" & s2 & ".doc" As
"D:\Documents and Settings\e345193\Desktop\Tools\New TCs\" & s1 & ".doc"
Else
End If
x = x + 1
s1 = ""
s2 = ""
Loop
End Sub