Dim Message, Title, Default, MyValue
Message = "點選完畢請按確定"
Title = "點選資料存放位置"
Default = "A1"
MyValue = Application.InputBox(Message, Title, Default, Type:=8)
R = ActiveCell.Row
C = ActiveCell.Column
Cells(R, C).Value = "E 值"
Cells(R, C + 1).Value = "N 值"
Cells(R, C + 2).Value = "EL 值"
Cells(R, C + 3).Value = "屬性"
R = R + 1作者: GBKEE 時間: 2011-5-23 06:48
回復 1#linsurvey2005
Dim Message As String, Title As String, Default As String, MyValue As Range
Dim R As Integer, C As Integer
Message = "點選完畢請按確定"
Title = "點選資料存放位置"
Default = "A1"
Set MyValue = Application.InputBox(Message, Title, Default, Type:=8)
'Type:=8 儲存格參照,作為 Range物件 前面要加 Set
' R = ActiveCell.Row ActiveCell為作用中的儲存格
'C = ActiveCell.Column
R = MyValue.Row ' 指定到MyValue
C = MyValue.Column
Cells(R, C).Value = "E 值"
Cells(R, C + 1).Value = "N 值"
Cells(R, C + 2).Value = "EL 值"
Cells(R, C + 3).Value = "屬性"
R = R + 1作者: linsurvey2005 時間: 2011-5-23 11:26
通了通了~感謝 GBKEE 的指導以下為修正成果
不知道這樣子是否通順 或是有更簡便的方法
真是感謝~舒服^^
Dim Message, Title, Default, MyValue
On Error Resume Next
Message = "點選完畢請按確定"
Title = "點選資料存放位置"
Default = "A1"
Set MyValue = Application.InputBox(Message, Title, Default, Type:=8)
If Err Then
Err.Clear
Exit Sub
End If
Const Rn = 3
DoEvents
R = MyValue.Row
C = MyValue.Column
Cells(R, C).Value = "點編"
Cells(R, C + 1).Value = "E 值"
Cells(R, C + 2).Value = "N 值"
Cells(R, C + 3).Value = "EL 值"
Cells(R, C + 4).Value = "屬性"
R = R + 1作者: GBKEE 時間: 2011-5-23 11:46