YellowLabPro
08-08-2007, 02:09 PM
I am testing on this block of code, it is in the rough draft stages. I breaks at this line- Worksheets("EC Products").Range("J4:J" & LRowc).Replace "39208", "5-6", xlWhole, False
which is stumping me. The workbook is open and I have checked the spelling of the sheet name. All looks ok...
Sub DougsFindAndReplacev2()
Dim Wsc As Worksheet
Dim c As Range, rng As Range
Dim LRowc As Long
Dim shCalcSetting As Long
Set Wsc = Workbooks("Complete_Upload_File.xls").Worksheets("EC Products")
LRowc = lr(Wsc, 1)
Set rng = Wsc.Range("J4:J" & LRowc)
shCalcSetting = Application.Calculation
'Application.ScreenUpdating = false
Application.Calculation = xlManual
'With Wsc
'For Each c In rng
'c.Value.Replace "39208", "5-6", xlWhole, False
'End With
'Next c
Worksheets("EC Products").Range("J4:J" & LRowc).Replace "39208", "5-6", xlWhole, False
' Range("M4:M" & LRowf).Replace "L", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "LARGE", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "LG", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "LRG", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "L/Xl", "Lg/Xl", xlWhole, False
'End With
ActiveSheet.Calculate
Application.Calculation = shCalcSetting
Application.ScreenUpdating = True
End Sub
which is stumping me. The workbook is open and I have checked the spelling of the sheet name. All looks ok...
Sub DougsFindAndReplacev2()
Dim Wsc As Worksheet
Dim c As Range, rng As Range
Dim LRowc As Long
Dim shCalcSetting As Long
Set Wsc = Workbooks("Complete_Upload_File.xls").Worksheets("EC Products")
LRowc = lr(Wsc, 1)
Set rng = Wsc.Range("J4:J" & LRowc)
shCalcSetting = Application.Calculation
'Application.ScreenUpdating = false
Application.Calculation = xlManual
'With Wsc
'For Each c In rng
'c.Value.Replace "39208", "5-6", xlWhole, False
'End With
'Next c
Worksheets("EC Products").Range("J4:J" & LRowc).Replace "39208", "5-6", xlWhole, False
' Range("M4:M" & LRowf).Replace "L", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "LARGE", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "LG", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "LRG", "Lg", xlWhole, False
' Range("M4:M" & LRowf).Replace "L/Xl", "Lg/Xl", xlWhole, False
'End With
ActiveSheet.Calculate
Application.Calculation = shCalcSetting
Application.ScreenUpdating = True
End Sub