Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Need Help On My codes

Hi
I have a marco written below, this is to find and open a file name with
"...H73FJ..."
My question is ... what or how should I add or write codes to my existing
macro below if I want to find a file name with "...H72FJ...." and if it is
not found .. then continue to find file name with "...H73FJ..." and if both
not found then message " No Production............" will appear. If anyone of
the files is found then continue macro. And then at the end I would like to
find the active file and closed it without any save changes...

Pls help ..... Thanks....


Private Sub V3DVH1stPassYield_Click()

'V3DVH1stPassYield_Click
'Recorded and Modified on 16 Aug 2005

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Range("A4:L2500").ClearContents
If Dir$(Range("I2513") & "H73FJ" & Range("J2516") & ".csv") = "" Then
Range("L2505") = "No Production Build or No Datas Found. PLS VERIFY"
Range("L2505").Select
Selection.Interior.ColorIndex = 45
Else
Workbooks.Open Filename:=Range("I2513") & "H73FJ" & Range("J2516") &
".csv"
Application.Run "V3_NewDeltaVH_Sort"
ActiveSheet.Range("A2:L2498").Select
Selection.Copy
Workbooks("DVH Template C Macro V3.xls").Activate
ActiveSheet.Name = "DVH V3 1st Pass"
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

Windows("H73FJ" & Range("J2516") & ".csv").Activate
Application.CutCopyMode = False
ActiveWindow.Close SaveChanges:=False
'ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]"

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Range("A2501").Select
End If

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Need Help On My codes

Private Sub V3DVH1stPassYield_Click()

'V3DVH1stPassYield_Click
'Recorded and Modified on 16 Aug 2005

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Range("A4:L2500").ClearContents
If Dir$(Range("I2513") & "H72FJ" & Range("J2516") & ".csv") = "" Or _
Dir$(Range("I2513") & "H73FJ" & Range("J2516") & ".csv") = "" Then
With Range("L2505")
.Value = "No Production Build or No Datas Found. PLS VERIFY"
.Interior.ColorIndex = 45
End With
Else
Workbooks.Open Filename:=Range("I2513") & "H73FJ" & Range("J2516") &
".csv"
Application.Run "V3_NewDeltaVH_Sort"
ActiveSheet.Range("A2:L2498").Copy
Workbooks("DVH Template C Macro V3.xls").Activate
ActiveSheet.Name = "DVH V3 1st Pass"
Range("A4").PasteSpecial Paste:=xlPasteValuesAndNumberFormats, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
Windows("H73FJ" & Range("J2516") & ".csv").Activate
Application.CutCopyMode = False
ActiveWindow.Close SaveChanges:=False
'ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]"
End If

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Range("A2501").Select

End Sub


--
HTH

Bob Phillips

"ddiicc" wrote in message
...
Hi
I have a marco written below, this is to find and open a file name with
"...H73FJ..."
My question is ... what or how should I add or write codes to my existing
macro below if I want to find a file name with "...H72FJ...." and if it is
not found .. then continue to find file name with "...H73FJ..." and if

both
not found then message " No Production............" will appear. If anyone

of
the files is found then continue macro. And then at the end I would like

to
find the active file and closed it without any save changes...

Pls help ..... Thanks....


Private Sub V3DVH1stPassYield_Click()

'V3DVH1stPassYield_Click
'Recorded and Modified on 16 Aug 2005

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Range("A4:L2500").ClearContents
If Dir$(Range("I2513") & "H73FJ" & Range("J2516") & ".csv") = "" Then
Range("L2505") = "No Production Build or No Datas Found. PLS

VERIFY"
Range("L2505").Select
Selection.Interior.ColorIndex = 45
Else
Workbooks.Open Filename:=Range("I2513") & "H73FJ" & Range("J2516")

&
".csv"
Application.Run "V3_NewDeltaVH_Sort"
ActiveSheet.Range("A2:L2498").Select
Selection.Copy
Workbooks("DVH Template C Macro V3.xls").Activate
ActiveSheet.Name = "DVH V3 1st Pass"
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

Windows("H73FJ" & Range("J2516") & ".csv").Activate
Application.CutCopyMode = False
ActiveWindow.Close SaveChanges:=False
'ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]"

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Range("A2501").Select
End If

End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Need Help On My codes

Hi Bob,
Thanks for the rescue.. but how abt the Work book opening part and also the
active windows closing part??

"Bob Phillips" wrote:

Private Sub V3DVH1stPassYield_Click()

'V3DVH1stPassYield_Click
'Recorded and Modified on 16 Aug 2005

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Range("A4:L2500").ClearContents
If Dir$(Range("I2513") & "H72FJ" & Range("J2516") & ".csv") = "" Or _
Dir$(Range("I2513") & "H73FJ" & Range("J2516") & ".csv") = "" Then
With Range("L2505")
.Value = "No Production Build or No Datas Found. PLS VERIFY"
.Interior.ColorIndex = 45
End With
Else
Workbooks.Open Filename:=Range("I2513") & "H73FJ" & Range("J2516") &
".csv"
Application.Run "V3_NewDeltaVH_Sort"
ActiveSheet.Range("A2:L2498").Copy
Workbooks("DVH Template C Macro V3.xls").Activate
ActiveSheet.Name = "DVH V3 1st Pass"
Range("A4").PasteSpecial Paste:=xlPasteValuesAndNumberFormats, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
Windows("H73FJ" & Range("J2516") & ".csv").Activate
Application.CutCopyMode = False
ActiveWindow.Close SaveChanges:=False
'ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]"
End If

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Range("A2501").Select

End Sub


--
HTH

Bob Phillips

"ddiicc" wrote in message
...
Hi
I have a marco written below, this is to find and open a file name with
"...H73FJ..."
My question is ... what or how should I add or write codes to my existing
macro below if I want to find a file name with "...H72FJ...." and if it is
not found .. then continue to find file name with "...H73FJ..." and if

both
not found then message " No Production............" will appear. If anyone

of
the files is found then continue macro. And then at the end I would like

to
find the active file and closed it without any save changes...

Pls help ..... Thanks....


Private Sub V3DVH1stPassYield_Click()

'V3DVH1stPassYield_Click
'Recorded and Modified on 16 Aug 2005

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Range("A4:L2500").ClearContents
If Dir$(Range("I2513") & "H73FJ" & Range("J2516") & ".csv") = "" Then
Range("L2505") = "No Production Build or No Datas Found. PLS

VERIFY"
Range("L2505").Select
Selection.Interior.ColorIndex = 45
Else
Workbooks.Open Filename:=Range("I2513") & "H73FJ" & Range("J2516")

&
".csv"
Application.Run "V3_NewDeltaVH_Sort"
ActiveSheet.Range("A2:L2498").Select
Selection.Copy
Workbooks("DVH Template C Macro V3.xls").Activate
ActiveSheet.Name = "DVH V3 1st Pass"
Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

Windows("H73FJ" & Range("J2516") & ".csv").Activate
Application.CutCopyMode = False
ActiveWindow.Close SaveChanges:=False
'ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]"

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Range("A2501").Select
End If

End Sub





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zip Codes Bill New Users to Excel 6 August 7th 08 10:47 PM
Codes sam Excel Discussion (Misc queries) 2 September 11th 07 02:04 PM
Need some help with codes Tom Excel Discussion (Misc queries) 2 August 16th 07 01:09 AM
Codes Heather Excel Worksheet Functions 4 March 23rd 06 11:41 PM
VBA Codes smck Excel Worksheet Functions 2 May 11th 05 10:03 AM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"