- Content page PreInit event.
- Master page controls Init event.
- Content controls Init event.
- Master page Init event.
- Content page Init event.
- Content page Load event.
- Master page Load event.
- Master page controls Load event.
- Content page controls Load event.
- Content page PreRender event.
- Master page PreRender event.
- Master page controls PreRender event.
- Content page controls PreRender event.
- Master page controls Unload event.
- Content page controls Unload event.
- Master page Unload event.
- Content page Unload event.
- The sequence of events in master
Read and share knowledge about Asp.Net, SharePoint, JavaScript and other Microsoft Technology.
Wednesday, March 3, 2010
Master Page - Content Page Life Cycle
Friday, December 25, 2009
Programatically copy worksheet via VBA in Excel
Dim oBook As Workbook Excel.Application.DisplayAlerts = False Application.ScreenUpdating = False Me.btnExportWorkSheet.TakeFocus<nClick = False ' Delete the Old File Kill "c:\FileName.xls" ' Create a new blank workbook: Set oBook = Application.Workbooks.Add Application.SheetsInNewWorkbook = 1 ' Add a defined name to the workbook ' that RefersTo a range: oBook.Names.Add Name:="tempRange", RefersTo:="=Sheet1!$A$1" ' Save the workbook: oBook.SaveAs "c:\FileName.xls" ' Select the Workbook where the Worksheet to be copied is located Workbooks("Old File.xls").Activate Workbooks("Old File.xls").Worksheets("Work Sheet A").Activate ' Copy the Worksheet to the Workbook Worksheets("Work Sheet A").Copy Before:=Workbooks("New Work Book.xls").Sheets(1) Dim xRange As Range, adr As String Workbooks("New Work Book.xls").Worksheets("Work Sheet A").Activate Workbooks("New Work Book.xls").Worksheets("Work Sheet A").Range("a1:z100").Activate ' Remove Links and Replace with Cell Values With Workbooks("New Work Book.xls").Worksheets("Work Sheet A") Dim cCell As Range Dim strValue As String Set xRange = .Range("a1:z100") For Each cCell In xRange ' Save the value to use as a means to identify what cells to change strValue = CStr(cCell.Value) If InStr(strValue, "/") > 0 Then cCell = CStr(cCell.Value) End If Next End With ' Select the next Workbook where the Worksheet to be copied is located Workbooks("Old File.xls").Activate Workbooks("Old File.xls").Worksheets("Work Sheet B").Activate ' Copy the Worksheet to the Workbook Worksheets("Work Sheet B").Copy Before:=Workbooks("CashFlowInput&DollarChart.xls").Sheets(1) ', UpdateLinks:=0 Workbooks("New Work Book.xls").Worksheets("Work Sheet B").Activate Workbooks("New Work Book.xls").Worksheets("Work Sheet B").Range("a1:z100").Activate ' Remove Links and Replace with Cell Values With Workbooks("New Work Book.xls").Worksheets("Dollars Chart") Set xRange = .Range("a1:z100") For Each cCell In xRange ' Save the value to use as a means to identify what cells to change ' cCell.Formula will show the link back to the Original Workbook strValue = CStr(cCell.Formula) If InStr(strValue, "!") > 0 Then cCell = CStr(cCell.Value) ' If cCell = .Range("b51") Or cCell = .Range("m4") Then ' Stop ' End If End If Next End With MsgBox ("Your Worksheets have been copied to C:\New Work Book.xls") End Sub
Tuesday, September 29, 2009
Sort Excel workbook sheet alphabatically
Sub Sort_Active_Book() Dim i As Integer Dim j As Integer Dim iAnswer As VbMsgBoxResult ' ' Prompt the user as which direction they wish to ' sort the worksheets. ' iAnswer = MsgBox("Sort Sheets in Ascending Order?" & Chr(10) _ & "Clicking No will sort in Descending Order", _ vbYesNoCancel + vbQuestion + vbDefaultButton1, "Sort Worksheets") For i = 1 To Sheets.Count For j = 1 To Sheets.Count - 1 ' ' If the answer is Yes, then sort in ascending order. ' If iAnswer = vbYes Then If UCase$(Sheets(j).Name) > UCase$(Sheets(j + 1).Name) Then Sheets(j).Move After:=Sheets(j + 1) End If ' ' If the answer is No, then sort in descending order. ' ElseIf iAnswer = vbNo Then If UCase$(Sheets(j).Name) < UCase$(Sheets(j + 1).Name) Then Sheets(j).Move After:=Sheets(j + 1) End If End If Next j Next i End Sub
Subscribe to:
Posts (Atom)