advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 37684 for IF (0.007 sec.)
[[20060924015703]]
#score: 1591
@digest: d93182325ade1f0b0be84819cf24fdac
@id: 25345
@mdate: 2006-09-24T12:24:46Z
@size: 3035
@type: text/plain
#keywords: sheetbeforerightclick (14599), ダス (10477), ララ (6512), ラダ (5757), target (3740), cancel (3019), 番シ (2779), ・キ (2428), 刷マ (2368), ・se (1736), boolean (1378), beforerightclick (1213), byval (1091), workbook (1038), exit (953), (ラ (930), 野鮎 (785), 川野 (749), 鮎太 (739), then (716), column (697), private (668), object (647), value (642), intersect (605), ル上 (545), リキ (520), 。pr (497), 太郎 (493), ス) (488), キリ (484), sub (465)
『シートモジュール』(ララダス)
Excel2002.WindowsXP使用 こちらの過去ログを参考に↓のコードを作りました。 同じマクロをsheet(1)〜sheet(13)に適用したいのですが、全てのシートにコードを記述する以外に方法は無いのでしょうか? 見ての通り、セル上で右クリックしたら"○"を表示すると言う物です。 Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If Target.Row < 4 Then Exit Sub If Target.Row > 34 Then Exit Sub If Target.Column > 8 Then Exit Sub If Target.Column < 5 Then Exit Sub Cancel = True If Target.Value = "○" Then Target.Value = "" Else Target.Value = "○" End If End Sub よろしくお願いします。 (ララダス) ---- ThisWorkBookモジュールに書き込みます。 Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) If Target.Row < 4 Then Exit Sub If Target.Row > 34 Then Exit Sub If Target.Column > 8 Then Exit Sub If Target.Column < 5 Then Exit Sub Select Case ActiveSheet.Index Case 1 To 13 Cancel = True If Target.Value = "○" Then Target.Value = "" Else Target.Value = "○" End If End Select End Sub 順番としては、どちらが良いのだろう・・・。 Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) Select Case ActiveSheet.Index Case 1 To 2 If Target.Row < 4 Then Exit Sub If Target.Row > 34 Then Exit Sub If Target.Column > 8 Then Exit Sub If Target.Column < 5 Then Exit Sub Cancel = True If Target.Value = "○" Then Target.Value = "" Else Target.Value = "○" End If End Select End Sub (川野鮎太郎) ---- こんな感じでよいのでは? Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) If Sh.Index > 13 Then Exit Sub If Intersect(Target,Sh.Range("e4:g34")) Is Nothing Then Exit Sub With Target Cancel = True If .Value = "○" Then .Value = "" Else .Value = "○" End If End With (seiya) ---- んだば、σ(^o^;)もw Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) Dim x As Range If Sh.Index > 13 Then Exit Sub For Each x In Target If Not Intersect(x, Sh.Range("E4:G34")) Is Nothing Then With x Cancel = True If .Value = "○" Then .Value = "" Else .Value = "○" End If End With End If Next x End Sub (キリキ)(〃⌒o⌒)b ---- 出来ました。(^o^) 川野鮎太郎さん・seiyaさん・キリキさんありがとうございました。 一番シンプルなseiyaさんのコードを使わせて頂きました。 それにしても色々な記述のしかたがあるものですね。 Ps.川野鮎太郎さん、印刷マクロの節はお世話になりました。 (ララダス) ...
https://www.excel.studio-kazu.jp/wiki/kazuwiki/200609/20060924015703.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97044 documents and 608215 words.

訪問者:カウンタValid HTML 4.01 Transitional