excel2007技巧之九.pdf
《excel2007技巧之九.pdf》由会员分享,可在线阅读,更多相关《excel2007技巧之九.pdf(50页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、ExcelExcelVBAExcelExcelExcelExcelOfficeInternetXMLExcelVBAVBA102Excel1ExcelB31.2.3.1.2.3.4.103Chapter 9Excel2C21.2.3.1.3.4.1043Excel2.105Chapter 9Excel4ExcelHYPERLINKC3=HYPERLINK(!F3)EnterC3C12D3=HYPERLINK(!C3)EnterD3D12106E3=SUM(C3+D3)EnterE3E12HYPERLINKInternetHYPERLINKMicrosoft Excellink_location
2、HYPERLINK(link_location,friendly_name)Link_locationFriendly_name5107Chapter 9ExcelCtrl6C21.2.3.1.2.3.4.1087ExcelA3:E3Ctrl+CB41.2.1.2.1.109Chapter 9Excel8ExcelCtrl+TSub()Macro :Ctrl+t Range(B3).Select Selection.Hyperlinks.Delete 1.2.1.2.1.2.110End Sub Range(B3).SelectRange(B3:E4).SelectExcelCtrl+T9Ex
3、celEnterEnterCtrl+ZAlt+F8SubEnd SubCells.Hyperlinks.DeleteExcel10ExcelSheet2Sheet3.Sheet1SheetA1Sheet2111Chapter 9ExcelA2Sheet3A1Sheet2A2Sheet3A1Sheet2A2Sheet311Visual BasicVisual BasicAlt+F11Microsoft Visual Basic|Sub()Dim Pt As Range Dim i As Integer With Sheet1 Set Pt=.Range(a1)For i=2 To ThisWor
4、kbook.Worksheets.Count .Hyperlinks.Add Anchor:=Pt,Address:=,SubAddress:=Worksheets(i).Name&!A1 Set Pt=Pt.Offset(1,0)Next i End With End Sub Microsoft Visual BasicExcelAlt+F8Sheet1111Chapter 9Excel1WordExcelWordExcelExcelWordWordExcelMicrosoft Office WordWordWordExcelWordExcelHTMLWordExcel2ExcelWordW
5、ordExcelExcelWord-ExcelExcelWordExcel112ExcelCtrl+CWordWordExcelWordWord1.113Chapter 9ExcelExcelWord3TXTExcelTXTExcelExcelTXT1.2.114TXTExcelTXTExcel4ExcelTXTTXTExcelExcelExcelOffice*.prn;*.txt;*.csv115Chapter 9Excel5ExcelExcelExcelWebExcel1.1166InternetExcel117Chapter 9Excel7ExcelAccessExcelAccess-E
6、xcel-ExcelCtrl+CAccessExcelAccessAccessExcelAccessAccesssExcel-Excel1.2.118-Excel-Excel-ExcelExcel1.2.1.2.2.119Chapter 9ExcelAccessExcelExcelAccesssExcel-ExcelExcel-ExcelAccess1.120-ExcelExcel8AccessExcelAccess 2007Excel-ExcelAccessAccessExcel121Chapter 9ExcelAccessCtrl+CExcelAccessExcelAccessAccess
7、ExcelAccessExcelExcelExcel1.2.122AccessExcelAccessExcelAccessOKOutlook123Chapter 9Excel9ExcelOffice|*.txtMicrosoft Offiice ExcelMicrosoft Offiice ExcelExcelExcel1 0ExcelExcelExcel1.2.124ExcelExcelOffice|*.htm;*.htmlMicrosoft Offiice Excel.filesExcelExcelOffice|*.htm;*.html1.2.125Chapter 9ExcelWebHTT
8、PFTPExcel1 1XM LExcelExcelXMLExcelXMLMicrosoft Offiice Excel1.2.126XMLExcel125Chapter 9ExcelVBA1VBAHello WorldVBAHello WorldAlt+F11VBA126Sheet1(Sheet1)Public Sub ExcelbaSub1()Dim TStr As String TStr=Hello World!Application.ActiveSheet.Range(A1).Value=TStr Debug.Print TStr MsgBox TStr,End Sub VBAShee
9、t1.Excelba Sub12Atl+F11VBA|2.1.2.127Chapter 9Excel1Function Age(BirthDate As Date)Select Case Month(Date)Case Is=Day(BirthDate)Then Age=Year(Date)-Year(BirthDate)+1 Else Age=Year(Date)-Year(BirthDate)End If Case Is Month(BirthDate)Age=Year(Date)-Year(BirthDate)+1 End Select End Function VBAA11984-12
10、-10B1B1=age(A1)EnterFunction Age(BirthDate As Date)Age=Int(Date-BirthDate)/365.25)+1 End Function 3VBAWindows DesktopMyDocumentsVBAAtl+F11VBAA1#VALUE!128Sheet1(Sheet1)Option Explicit Sub GetMyDocumentsPath()Dim WSHShell As Object Set WSHShell=CreateObject(Wscript.Shell)MsgBox MyDocuments&WSHShell.Sp
11、ecialFolders(MyDocuments)Set WSHShell=Nothing End Sub VBASheet1.List FormulasMyDocumentsAllUsersDesktop AllUsersStartMenu AllUsersPrograms AllUsersStartup Desktop Favorites Fonts MyDocumentsMyDocuments1.2.1.2.129Chapter 9ExcelMyDocuments NetHood PrintHood Programs Recent SendTo StartMenu Startup Tem
12、plates 4Shift|Shift|1.2.1.2.1.2.1305VBAExcelVBAA1:A6Atl+F11VBASheet1(Sheet1)Sub ConvertToEmail()Dim convertRng As Range Set convertRng=Range(F2:F18)Dim rng As Range For Each rng In convertRng If rng.Value Then ActiveSheet.Hyperlinks.Add rng,mailto:&rng.Value End If Next rng End Sub VBACtrl+X1.2.1.1.
13、2.2.131Chapter 9ExcelSheet1.ConvertTo Email6VBAExcel VBAAtl+F11VBA|Sub Remove_WorkSheet_Password()Dim i As Integer,j As Integer,k As Integer Dim l As Integer,m As Integer,n As Integer Dim i1 As Integer,i2 As Integer,i3 As Integer Dim i4 As Integer,i5 As Integer,i6 As Integer On Error Resume Next If
14、ActiveSheet.ProtectContents=False Then MsgBox Exit Sub End If For i=65 To 66:For j=65 To 66:For k=1.1.13265 To 66 For l=65 To 66:For m=65 To 66:For i1=65 To 66 For i2=65 To 66:For i3=65 To 66:For i4=65 To 66 For i5=65 To 66:For i6=65 To 66:For n=32 To 126 ActiveSheet.Unprotect Chr(i)&Chr(j)&Chr(k)&_
15、 Chr(l)&Chr(m)&Chr(i1)&Chr(i2)&Chr(i3)&_ Chr(i4)&Chr(i5)&Chr(i6)&Chr(n)If ActiveSheet.ProtectContents=False Then MsgBox Exit Sub End If Next:Next:Next:Next:Next:Next Next:Next:Next:Next:Next:Next End Sub VBARemove_Work Sheet_Password7VBAVBAVBAA1:A101-101.2.133Chapter 9ExcelAtl+F11VBASheet1(Sheet1)Su
16、b RndNumberNoRepeat()Dim RndNumber,TempArray(9),i As Integer Randomize(Timer)For i=0 To 9 1100TempArray(i)=i Next i For i=9 To 0 Step-1 RndNumber=Int(i*Rnd)A1:A100Cells(10-i,1)=TempArray(RndNumber)+1 TempArray(RndNumber)=Temp Array(i)Next i End Sub VBA|Sheet1.RndNumber NoRepeat2.1.1.2.1348WordVBAWor
17、dAtl+F11VBA|VBAprojectMicrosoft Word 11.0 Object LibraryVBA|Public Sub PrintFormulasToWord()Dim Cnt As String Dim C As Range Dim WordObj As Word.Application Dim HasArr As Boolean On Error Resume Next Err.Number=0 Set WordObj=GetObject(,Word.Application)If Err.Number=429 Then Set WordObj=CreateObject
18、(Word.Application)Err.Number=0 End If WordObj.Visible=True WordObj.Documents.Add With WordObj.Selection.Font.Name=Courier New.TypeText +Active Sheet.Name.TypeParagraph.TypeText +Selection.Cells(1,1).Address(False,False,xlA1)_&to&Selection.Cells(Selection.Rows.Count,_ Selection.Columns.Count).Address
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- excel2007 技巧
限制150内