Click here to Skip to main content
15,906,094 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generaldatarow Pin
besah12-Jan-05 15:02
besah12-Jan-05 15:02 
GeneralRe: datarow Pin
Ritesh123413-Jan-05 3:28
Ritesh123413-Jan-05 3:28 
QuestionHow to format field value in crystal report Pin
viettho12-Jan-05 13:16
viettho12-Jan-05 13:16 
AnswerRe: How to format field value in crystal report Pin
Bad Sector12-Jan-05 19:01
Bad Sector12-Jan-05 19:01 
GeneralRe: How to format field value in crystal report Pin
viettho14-Jan-05 7:20
viettho14-Jan-05 7:20 
GeneralExcel Pin
Britnt712-Jan-05 9:23
Britnt712-Jan-05 9:23 
GeneralRe: Excel Pin
Dave Kreskowiak12-Jan-05 12:02
mveDave Kreskowiak12-Jan-05 12:02 
GeneralRe: Excel Pin
Ritesh123413-Jan-05 3:42
Ritesh123413-Jan-05 3:42 
Hi,
This is what i got form MSDN ....................


You can add one or more worksheets to the Worksheets collection by using the collection's Add method. The Add method returns the new Worksheet object. If you add multiple worksheets, the Add method returns the last worksheet added to the Worksheets collection. If the Before or After arguments of the Add method are omitted, the new worksheet is added before the currently active worksheet. The following example adds a new worksheet before the active worksheet in the current collection of worksheets:
Dim wksNewSheet As Excel.Worksheet

Set wksNewSheet = Worksheets.Add
With wksNewSheet
   ' Work with properties and methods of the
   ' new worksheet here.
End With
You use the Worksheet object's Delete method to delete a worksheet from the Worksheets collection. When you try to programmatically delete a worksheet, Microsoft® Excel will display a message (alert); to suppress the message, you must set the Application object's DisplayAlerts property to False, as illustrated in the following example:
Function DeleteWorksheet(strSheetName As String) As Boolean
   On Error Resume Next
   
   Application.DisplayAlerts = False
   ActiveWorkbook.Worksheets(strSheetName).Delete
   Application.DisplayAlerts = True
   ' Return True if no error occurred;
   ' otherwise return False.
   DeleteWorksheet = Not CBool(Err.Number)
End Function
Note   When you set the DisplayAlerts property to False, always set it back to True before your procedure has finished executing, as shown in the preceding example.
You can copy a worksheet by using the Worksheet object's Copy method. To copy a worksheet to the same workbook as the source worksheet, you must specify either the Before or After argument of the Copy method. You move a worksheet by using the Worksheet object's Move method. For example:
Worksheets("Sheet1").Copy After:=Worksheets("Sheet3")
Worksheets("Sheet1").Move After:=Worksheets("Sheet3")
The next example illustrates how to move a worksheet so that it is the last worksheet in a workbook:
Worksheets("Sheet1").Move After:=Worksheets(Worksheets.Count)


I hope this will help u................:->

Regards,
Ritesh
GeneralRe: Excel Pin
Britnt713-Jan-05 4:20
Britnt713-Jan-05 4:20 
GeneralRe: Excel Pin
Ritesh123413-Jan-05 3:47
Ritesh123413-Jan-05 3:47 
GeneralPopulating grid with months of a year Pin
Paps212-Jan-05 7:45
Paps212-Jan-05 7:45 
GeneralFormat date function and variables Pin
Drexel GG12-Jan-05 6:19
sussDrexel GG12-Jan-05 6:19 
GeneralRe: Format date function and variables Pin
Dave Kreskowiak12-Jan-05 8:43
mveDave Kreskowiak12-Jan-05 8:43 
GeneralRe: Format date function and variables Pin
Anonymous12-Jan-05 10:38
Anonymous12-Jan-05 10:38 
Generaldatasets (vb.net 2003) Pin
std770212-Jan-05 4:10
std770212-Jan-05 4:10 
GeneralSendMessage() Function Help Pin
Damian Castroviejo12-Jan-05 2:38
Damian Castroviejo12-Jan-05 2:38 
GeneralRe: SendMessage() Function Help Pin
Dave Kreskowiak12-Jan-05 4:20
mveDave Kreskowiak12-Jan-05 4:20 
GeneralRe: SendMessage() Function Help Pin
Damian Castroviejo13-Jan-05 2:11
Damian Castroviejo13-Jan-05 2:11 
GeneralRe: SendMessage() Function Help Pin
Dave Kreskowiak13-Jan-05 3:37
mveDave Kreskowiak13-Jan-05 3:37 
GeneralRe: SendMessage() Function Help Pin
Damian Castroviejo13-Jan-05 6:02
Damian Castroviejo13-Jan-05 6:02 
GeneralPage subtotal in MS Access 2003 Report Pin
steff kamush12-Jan-05 2:35
steff kamush12-Jan-05 2:35 
GeneralRe: Page subtotal in MS Access 2003 Report Pin
Dave Kreskowiak12-Jan-05 3:59
mveDave Kreskowiak12-Jan-05 3:59 
GeneralUpdateLayeredWindow - My great pain :) Pin
Axonn Echysttas11-Jan-05 21:46
Axonn Echysttas11-Jan-05 21:46 
GeneralRe: UpdateLayeredWindow - My great pain :) Pin
Dave Kreskowiak12-Jan-05 4:56
mveDave Kreskowiak12-Jan-05 4:56 
GeneralRe: UpdateLayeredWindow - My great pain :) Pin
Axonn Echysttas12-Jan-05 21:39
Axonn Echysttas12-Jan-05 21:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.