advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 470 for EDATE (0.000 sec.)
[[20041119225019]]
#score: 9974
@digest: d378b57facbf9032717d3d7820a488c7
@id: 10333
@mdate: 2004-11-20T02:26:09Z
@size: 3029
@type: text/plain
#keywords: findaddress (48690), 刻() (13625), 打刻 (12693), 勤勤 (8325), 刻場 (7815), sdate (5861), 水6 (4306), 土9 (4150), 力制 (4127), 度打 (4089), 火5 (3731), 金8 (2901), 付曜 (2859), 退勤 (2802), 木7 (2763), シル (2586), 勤退 (2560), mydate (1782), ン以 (1769), isempty (1716), 点2 (1666), 日出 (1630), 点1 (1620), edate (1540), 題点 (1523), protect (1467), 出勤 (1391), ーボ (1266), myrow (1112), 務時 (1018), 勤務 (952), ピ主 (938)
『キーボードからの入力制限』(あっち)
数日前にもお世話になりました。 自作のタイムカードをエクセルで作っています。 マクロで出勤、退勤の打刻を出来るようにしたいのですが、今現在は a b c d e 1 日付 曜日 出勤 退勤 勤務時間 2 1 日 3 2 月 4 3 火 というシートの出勤、退勤をコマンドボタンで入力できるように Sub 打刻() ActiveCell.FormulaR1C1 = "=NOW()" Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False End Sub としています。 日付と曜日はシルアル値になっています。 問題点1 時刻をコマンドボタン以外では入力制限をしたい(キーボードやできれば2度打刻) 問題点2 打刻場所をアクティブにしなくても適切な場所に入力したい ちなみに勤務可能な時間は9:00から翌日5時です 可能でしょうか?アドバイスをよろしくお願いします。 ---- 以下のような表があるとして、マクロでならこんな感じでどうでしょうか。 A B C D E 1 日付 曜日 出勤 退勤 勤務時間 2 11/14 日 3 11/15 月 4 11/16 火 5 11/17 水 6 11/18 木 7 11/19 金 8 11/20 土 9 11/21 日 10 11/22 月 11 11/23 火 12 11/24 水 13 11/25 木 14 11/26 金 15 11/27 土 16 11/28 日 17 11/29 月 18 11/30 火 Option Explicit Sub 打刻() Dim SDate As Variant, EDate As Variant Dim MyDate As Date Dim MyRow As Long Dim c As Range Dim FindAddress As String MyDate = Date MyRow = Range("A65536").End(xlUp).Row With Worksheets("Sheet1").Range("A2:A" & MyRow) Set c = .Find(MyDate, LookIn:=xlFormulas) If Not c Is Nothing Then FindAddress = c.Address SDate = Range(FindAddress).Offset(, 2).Value EDate = Range(FindAddress).Offset(, 3).Value Else MsgBox ("該当する日がありません") Exit Sub End If End With If IsEmpty(SDate) = False And _ IsEmpty(EDate) = False Then Exit Sub ActiveSheet.Unprotect If Range(FindAddress).Offset(, 2).Value = "" Then Range(FindAddress).Offset(, 2).Value = Format(Now, "hh:mm") Else Range(FindAddress).Offset(, 3).Value = Format(Now, "hh:mm") End If ActiveSheet.Protect End Sub 参考までにどうぞ。 http://skyblue123.hp.infoseek.co.jp/Excel/TimeCard.xls (川野鮎太郎) ------ σ(^◇^;)もちょっと考えてみました。 今のトピ主さんのマクロはNOWをコピーして値の貼り付けで確定してるんですよね? 検索するんなら鮎ちゃんの方法がいいと思いますが、別案でダブルクリックはどうでしょうか? 指がつるかな?(^^;;; まぁ、ご参考までにどうぞv(=∩_∩=)v (SoulMan) Option Explicit Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If Intersect(Target, Range("C2:D4")) Is Nothing Then Exit Sub Cancel = True Me.Protect , , , , True If IsEmpty(Target.Value) Then Target.Value = Format(Now, "hh:mm") End If End Sub http://ryusendo.no-ip.com/cgi-bin/upload/src/up0167.xls ...
https://www.excel.studio-kazu.jp/wiki/kazuwiki/200411/20041119225019.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97050 documents and 608253 words.

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