我也是不得已啊,看上很多想买的资料,但没钱啊,现在已经把价格减少为5了,以下为节选:
1、如何在Excel中控制某一单元格不可编辑?
Private Sub Workbook_Open()
ProtectSpecialRange ("A1")
End Sub
Sub ProtectSpecialRange(RangeAddress As String)
On Error Resume Next
With Sheet1
.Cells.Locked = False
.Range(RangeAddress).Locked = True
.Protection.AllowEditRanges.Add Title:="区域1", Range:=Range
(RangeAddress) _
, Password:="pass"
.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End With
End Sub
2、如何在VBA里判断工作表的记录总数?
x=1
do while not (isempty(sheets("").cells(x,1).value)
x=x+1
loop
[此贴子已经被作者于2008-4-14 9:46:50编辑过]