advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 1215 for (Mook) (0.001 sec.)
[[20150327143730]]
#score: 9211
@digest: 66ecdc5e17712fe9b0f1330bb9e9bc88
@id: 67619
@mdate: 2015-03-27T06:20:07Z
@size: 3165
@type: text/plain
#keywords: ff837764 (7748), querytables (6424), ズメ (5890), xlspecifiedtables (4419), スズ (3850), xlwebformattingnone (3641), webformatting (3615), backgroundquery (3549), webselectiontype (3540), weekday (2834), xlinsertdeletecells (2489), destination (2441), savepassword (2416), fieldnames (2416), refreshperiod (2368), filladjacentformulas (2368), refreshonfileopen (2354), 推定 (2340), preserveformatting (2340), connection (2321), rownumbers (2306), savedata (2276), adjustcolumnwidth (2179), refreshstyle (2127), 力先 (2106), 、we (1771), タ型 (993), library (979), datevalue (959), 2015 (875), シリ (770), も動 (658)
『変数の型?について』(スズメ)
http://www.excel.studio-kazu.jp/kw/20150322143808.html この続きです。 条件付き書式で、 weekdayの()の中は文字列を入れないとうまく動かないというのはわかりました。では、webクエリの場合はなぜ文字列でなくても動くのでしょうか? Sub test() Dim a As String Dim b As Integer Dim c As Integer b = 1 c = 1 Do Until b = 236 a = Cells(b, 19).Value With ActiveSheet.QueryTables.Add(Connection:= _ a _ , Destination:=Cells(c, 1)) .Name = _ "daily_a1.php?prec_no=43&block_no=0363&year=1995&month=4&day=&view=" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingNone .WebTables = """tablefix1""" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With c = c + 37 b = b + 1 Loop End Sub Destination:=Cells(c, 1)) の部分は、Cells(c,1)という文字でないものが入っても動きます。 これを実行したとき、ふつうなら0(ここのセルには何も書かれていなかった。)が入っておかしなことになると思うのですが、なぜ動くのでしょうか?よろしくお願いします。 < 使用 Excel:Excel2007、使用 OS:Windows7 > ---- 質問の意味がよくわかりませんが、 QueryTables.Add(Connection:= a , Destination:=Cells(c, 1)) このDestination で指定するものは、セルに入った値ではなく、結果をセットする領域の先頭の【Range型】変数ですから Cells(c, 1) といったもので、なんの不思議もありませんが? https://msdn.microsoft.com/ja-jp/library/office/ff837764.aspx (β) 2015/03/27(金) 15:00 ---- weekday関数は、元となる値がなければ計算できないから、省略するとエラー。 QueryTables.Addは、Destinationは結果の出力先を指定するのであり、Cells(c, 1)はちゃんと出力先のRange指定になっているから正常動作。それだけの事では? (Cells(c, 1).Valueだったら、セルに入っている値になるから、エラーかな) (???) 2015/03/27(金) 15:06 ---- 細かいことですが、Weekday の引数は文字列ではなく日付のシリアル値です。 https://support.office.com/ja-jp/article/WEEKDAY-%E9%96%A2%E6%95%B0-60e44483-2ed1-439f-8bd0-e404c190949a?ui=ja-JP&rs=ja-JP&ad=JP ただ、EXCEL 君は時に親切(場合によっては余計なお世話)で、文字列であっても 日付と推定されるときには、日付(シリアル値)に変換して解釈してくれます。 ですので、"2015/3/27" は Weekday のなかでは、DATEVALUE("2015/3/27") として 42090 の数値として処理しています。 そのあたりは、それぞれの関数の引数のデータ型を確認すると良いのではないでしょうか。 (Mook) 2015/03/27(金) 15:11 ---- なるほど、weekday関数とActiveSheet.QueryTables.Addは入れる変数の型が違うということですね。みなさんどうもありがとうございました。 (スズメ) 2015/03/27(金) 15:20 ...
http://www.excel.studio-kazu.jp/wiki/kazuwiki/201503/20150327143730.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97012 documents and 608126 words.

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