teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

エラー部分の記載

2023/05/18 03:26

投稿

taroooo
taroooo

スコア16

title CHANGED
File without changes
body CHANGED
@@ -9,8 +9,9 @@
9
9
  ### 発生している問題・エラーメッセージ
10
10
 
11
11
  エラーメッセージ
12
- 実行時エラー1004 アプリケーション定義またはオブジェクト定義のエラーです。
13
12
 
13
+ 実行時エラー1004 アプリケーション定義またはオブジェクト定義のエラーです。.Add Type:=~の部分を実行すると、エラー起きます。
14
+
14
15
  ### 該当のソースコード
15
16
 
16
17
  dropDownValues = Split("30,35,40,45,50,60,65,70,75,80,85,90,95,100") ' ドロップダウンリストを設定する
@@ -33,9 +34,9 @@
33
34
 
34
35
  With Range("E" & u).Validation
35
36
  .Delete
36
- .Add Type:=xlValidateList, _
37
+ .Add Type:=xlValidateList, _  →ここでエラーおきます。
37
38
  AlertStyle:=xlValidAlertStop, _
38
- Formula1:=Join(dropDownValues, ",")
39
+ Formula1:=Join(dropDownValues, ",") 
39
40
 
40
41
  '赤枠にする
41
42
  Range("E" & u).Borders.Color = RGB(255, 0, 0)

1

AlertStyle:=xlValidAlertInformation→AlertStyle:=xlValidAlertStopにプログラムを修正しています。

2023/05/18 02:58

投稿

taroooo
taroooo

スコア16

title CHANGED
File without changes
body CHANGED
@@ -34,7 +34,7 @@
34
34
  With Range("E" & u).Validation
35
35
  .Delete
36
36
  .Add Type:=xlValidateList, _
37
- AlertStyle:=xlValidAlertInformation, _
37
+ AlertStyle:=xlValidAlertStop, _
38
38
  Formula1:=Join(dropDownValues, ",")
39
39
 
40
40
  '赤枠にする