rakesh seebaruth
Active Member
- Joined
- Oct 6, 2011
- Messages
- 303
Hi Guys
I have the following vba codes
Sub d()
Range("b2") = Format(Date, "dd/mmmm/yyyy")
Const mydrive = "C:"
Const mydir = "Users\rakesh\Desktop\test"
Dim myname As String
Dim ss As String
myname = Sheets("sheet1").Range("e5").Text & Format(Date, "dd-mmm-yy") & ".xls"
ss = mydrive & "" & mydir & "" & myname & ".xls"
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=ss
Application.DisplayAlerts = True
End Sub
the following vba works perfectly i want to amend the above as follows :
I want to insert a Case statement in the above like that
Select Case Range("D2").Value
Case "CB"
If D2="CB" then save file in folder C:Users\rakesh\Desktop\test\corporate.Folder corporate already exists in folder C:Users\rakesh\Desktop\test.
If D2="PB" then save file in folder C:Users\rakesh\Desktop\test\private banking.Folder private banking already exists in folder C:Users\rakesh\Desktop\test.
Thanks in advance
Regards
Rakesh
I have the following vba codes
Sub d()
Range("b2") = Format(Date, "dd/mmmm/yyyy")
Const mydrive = "C:"
Const mydir = "Users\rakesh\Desktop\test"
Dim myname As String
Dim ss As String
myname = Sheets("sheet1").Range("e5").Text & Format(Date, "dd-mmm-yy") & ".xls"
ss = mydrive & "" & mydir & "" & myname & ".xls"
Application.DisplayAlerts = False
ActiveWorkbook.SaveCopyAs Filename:=ss
Application.DisplayAlerts = True
End Sub
the following vba works perfectly i want to amend the above as follows :
I want to insert a Case statement in the above like that
Select Case Range("D2").Value
Case "CB"
If D2="CB" then save file in folder C:Users\rakesh\Desktop\test\corporate.Folder corporate already exists in folder C:Users\rakesh\Desktop\test.
If D2="PB" then save file in folder C:Users\rakesh\Desktop\test\private banking.Folder private banking already exists in folder C:Users\rakesh\Desktop\test.
Thanks in advance
Regards
Rakesh