アフィリエイト広告を利用しています

広告

この広告は30日以上更新がないブログに表示されております。
新規記事の投稿を行うことで、非表示にすることが可能です。
posted by fanblog

2020年01月22日

PivotTableを更新する

Sub PivotTableを更新する()
Dim mySheet As Worksheet
Dim pvt As PivotTable

'全シート
For Each mySheet In Worksheets

'
For Each pvt In mySheet.PivotTables
pvt.PivotCache.Refresh
Next


Next mySheet


End Sub

’テーブルクリア例
Range("A2:L2").ClearContents
Range("A3:M" & Range("A3").End(xlDown).Row).Delete


’Resize例
Do
i = i + 1

If InStr(Sh1.Cells(i, 10), "株式会社") > 0 Then
x = x + 1
Sh2.Cells(x, 1).Resize(1, 12).Value = _
Sh1.Cells(i, 1).Resize(1, 12).Value

End If

Loop Until Sheet1.Cells(i, 1) = ""

’ファイルを選択例
Dim OpenFilePath As String
OpenFilePath = Application.GetOpenFilename("Microsoft Excelブック,*.xls?")

’セルのセレクト例
Cells(Rows.Count, "A").End(xlUp).Offset(10, 0).Select
【このカテゴリーの最新記事】

2019年10月11日

vbs MEMO book open

Option Explicit
Dim Rng,fso
Dim time5

sub window_onload()
call pageVis("TopPage")
end sub

sub exceltimer()
time5=Window.setTimeout("excel()",1000)
end sub

' Excel起動
sub excel()
document.getElementById("status").style.visibility="visible"
Dim ex,book,sheet,full_path,Rngs
Set ex = CreateObject("Excel.Application")
Set fso = CreateObject("Scripting.FileSystemObject")

ex.Visible = false
ex.DisplayAlerts = false

full_path = absolute_path( "1DB/book1.xlsx" )
set book = ex.Workbooks.Open( full_path )
set sheet = book.Sheets(1)
Rngs=sheet.Range(sheet.Cells(1,1),sheet.Cells(10,10))
Rng=Rngs 'msgbox Rng(10,2)
'Workbookを閉じる
book.Close(false)

document.getElementById("status").style.visibility="hidden"
call setting
end sub

Function absolute_path( path )
absolute_path= fso.getAbsolutePathName( path )
End Function

HTA MEMO

< title>HTA SAMPLE 01< /title>


< input type="text">
< button onclick="input()">input< /button>
< button onclick="sbHttp()">sbHttp< /button>
< div id="input_table">
< /div>


< script language="vbscript">
Dim InputTsk
Dim tb
set tb=document.getElementById("input_table")

sub input()
'msgbox "input buttonが押されました。"

tb.innerHtml=tb.innerHtml & "< p>input procedureが実行されました。< /p>"
'msgbox tb.innerHtml
CreateObject("Shell.Application").ShellExecute "C:\Program Files\Google\Chrome\Application\chrome.exe","file:///C:/Users.........html"
end sub


Sub sbHttp()

Dim Http,strST
'リンクをクリックする - VBAによるIE自動制御
Set Http = CreateObject("MSXML2.ServerXMLHTTP")

Http.Open "GET", "https://www.post.japanpost.jp/kt/zip/" & _
"e2.cgi?z=" & "1740075" & "&xr=1", False
Http.Send
strHT = StrConv(Http.ResponseBody, vbUnicode)
'strHT =Http.ResponseBody
Set Http = Nothing

tb.innerTEXT=strHT
end sub


< /script>
< script language="javascript">
var tb = document.getElementById("input_table");
window.onload = function() {

}
window.onbeforeunload = function(){
return "本当に離れますか?";
}

< /script>


< HTA:APPLICATION
ID="oHTA" APPLICATIONNAME="name" BORDER="thick"
BORDERSTYLE="normal" CAPTION="yes" CONTEXTMENU="yes" ICON="./icon.ico"
INNERBORDER="no" MAXIMIZEBUTTON="yes" MINIMIZEBUTTON="yes"
NAVIGABLE="no" SCROLL="yes" SCROLLFLAT="yes" SELECTION="yes" SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes" SYSMENU="yes" VERSION="0.0.1" WINDOWSTATE="normal"
/>
< meta http-equiv="content-type" content="text/html; charset=UTF-8">

2019年08月03日

footer

footer{
width:100%;
height:20px;
background-color: rgb(0,0,0);
background-size: cover;
box-shadow:0px -10px 10px rgba(0,0,0,0.3);
position:fixed;
z-index:100;
top:100%;
left:0;
margin-top: 0px;
}

2019年08月02日

FontFamily

font face="HG行書体 ,Osaka−等幅 , sans-serif

titleFontFamily:"'Trebuchet MS', Helvetica, sans-serif"

bodyFontFamily:"'Trebuchet MS', Helvetica, sans-serif",


boxWidth:10,

Color: '#df7970'

Color:'#6d78ad',

Color:'#51cda0'

< div style="transform:scale(0.75);transform-origin:0 0;width: 130%;">
     < style="position: relative; height:350px; width:95%;margin:0 0 0 30px;font-family:'Trebuchet MS', Helvetica, sans-serif;">
< /div>

  < div style="transform:scale(0.93);margin:-100px 0 ;transform-origin:0 0;" >< /div>
 
< /div>

var table = document.getElementById("table1_div")
var tabler= table.getElementsByTagName('table')[0]
var tr = tabler.getElementsByTagName("tr")


for(var i=1;i< tr.length;i++){
var td = tr[i].getElementsByTagName('td');
for( var j = 2; j < td.length; j++ ) {
td[j].onclick = function (event) {
console.log(event+"tr+:" + i + " +td+:" + j)
console.log(event.path[0].cellIndex)

// clmfont(event.path[0].cellIndex)


}
}

}
var $sampleAElements = document.getElementsByClassName( "google-visualization-table-td" );
for( var $i = 0; $i < $sampleAElements.length; $i++ ) {
$sampleAElements[$i].onmouseover= function (event) {
clmfont(event.path[0].cellIndex)
}
}
var $sampleAElements = document.getElementsByClassName( "google-visualization-table-td" );
for( var $i = 0; $i < $sampleAElements.length; $i++ ) {
$sampleAElements[$i].onmouseout= function (event) {
clmfontNone(event.path[0].cellIndex)
}
}
};

function clmfont(t){

var table = document.getElementById("table1_div")
var tabler= table.getElementsByTagName('table')[0]
var tr = tabler.getElementsByTagName("tr")

    for(var i=1;i< tr.length;i++){
var trRow =tr[i]
var tder = trRow.getElementsByTagName('td')[t];
console.log("i:" + i + " +td[NUM]:" + t)
tder.style.color = "";
tder.style.fontSize="12px"
    }



}


tr-head{color:white;font-size:8px;font-family: "Trebuchet MS", Helvetica, sans-serif;}
table tr{height:35px;/* background-color: #7b7676; */}
table-table {text-align:center; text-shadow: 0 0.05px 0px black}
table tr td{width:70px;white-space: nowrap;font-size:8px;font-family: "Trebuchet MS", Helvetica, sans-serif;}
table {width: 100%;}


'sort':'disable',

'allowHtml': true,

2019年07月30日

shadow


iframe {position:absolute;top:55px;transition-duration:0.7s;width:100%;height:calc(100vh - 50px)}
.frmshadow{
cursor:pointer;
top: 55px;
background-color: white;
background-color: white;
box-shadow: -3px -3px 17px 0px #00000061;
border-radius: 6px;
transform: rotate(-0.1deg);

transform-origin:right top;
/*
transform:rotateY(20deg);
*/
}
.fset{
top:50px;
left;0px;
}

function menuSlide(){

document.getElementById("menu").style.left=0;
document.getElementById("menusheet").style.visibility="visible";
// elm[fnum].style.left=50+"px";
// elm[fnum].style.top=70+"px";
changefrm(fnum)
}
function menuSlideLoad(){
document.getElementById("menu").style.left=-255+"px";
document.getElementById("menusheet").style.visibility="hidden";
for(var i =0;i<=fnum;i++){
elm[i].className="fset"
elm[i].style.left=0;
elm[i].style.top=50+"px";
elm[i].style.transform ="scale(1,1)"
};
}



function frmChange(URL){
document.getElementById("f0").src=URL
//menuSlide()
changefrm(0)
}



// iframeを取得
var elm = document.getElementsByTagName("iframe");
var fnum=0
elm[fnum].style.left=0;
elm[fnum].style.top=50+"px";


function changefrm(frmNum){
fnum=frmNum
var flag=false
var cnt=0
for(var i =0;i<=elm.lenght;i++){elm[i].className = 'frmshadow' };
for (var i = 3;i>frmNum; i--){

if(elm[i].style.left==(150*(i+1))+"px"){

setTimeout("Right('"+i+"')", 100*cnt);
cnt+=1
flag=true


}


}

cnt=0
for (var i = 0;i< frmNum+1; i++){
elm[i].className = 'frmshadow'
if(!flag && elm[i].style.left!=150*(Number(i)+1)+"px"){
setTimeout("Left('"+i+"')", 100*cnt);
cnt+=1
}
}
}


function Right(i){

elm[i].style.left=(120)+"%"
elm[i].style.top=58+"px"

}
function Left(i){

elm[i].style.left=(150*(Number(i)+1))+"px";
elm[i].style.top=60+(i*2)+"px";
elm[i].style.transform ="scale(0.9,1)"
// alert("frame"+i+": "+elm[i].style.left)

}

2019年07月28日

screen

height:calc(100vh - 50px)


@media screen and (max-width: 800px){
.none {display:none}
}


var elm = document.getElementsByTagName("iframe");

//changefrm(0)
changeParentHeight()

function changefrm(Num){

elm[Num].style.display= "block";
for (var i = 0;i< elm.length; i++){
if(frmNum!=i){
elm[i].style.display="none";
}
}
}

var m=document.getElementById("menu")
var elmli = m.getElementsByTagName("li");

function clk(url,num){
for(var i=2;i>0;i--){
document.getElementById("f2").src=url+"#p"+i
}
document.getElementById("f2").src=url+"#"
}

2019年07月27日

frozenColumns

function Redata() {
var num=0
myChart1.data.datasets.forEach(function(dataset) {
var i=1 ;num+=1
switch(num){case 1:n=5;break;case 2:n=7;break;case 3: n=4 ;break;case 4: n=2 ;break;}
console.log(num)

dataset.data = dataset.data.map(function() {
i+=1;

return AAA[dt][n][i]
});
});
myChart1.options.animation.easing='linear';
myChart1.options.animation.duration= 0;
myChart1.update();
//myChart1.options.animation.easing='easeOutBounce';
//myChart1.options.animation.duration= 12500;
}


'frozenColumns':2},

2019年07月19日

SE




function top_linebar(){
var [a,b,c,d,e,f,g]=AAA[1][0]
var ctx1 = document.getElementById('myChart').getContext('2d');

var myChart1 = new Chart(ctx1,{
type: 'bar',
data: {
labels:arraySE(AAA[1][0],2,100),
datasets: [{
type: 'line',
label: 'C',
data: arraySE(AAA[1][5],2,100),
backgroundColor: "rgba(0,0,0,0.0)",
borderColor: '#bf504e',
borderWidth: 2,
pointBackgroundColor: '#bf504e',
yAxisID: 'right',

}, {
type: 'line',
label: 'C',
data: arraySE(AAA[1][7],2,100),
backgroundColor: "rgba(0,0,0,0.0)",
borderColor: '#f98461',
borderWidth: 2,
pointRadius:0,
yAxisID: 'right'
},{
type: 'bar',
label: 'B',
data: arraySE(AAA[1][4],2,100),
backgroundColor:'#51cda0',
yAxisID: 'left'
}, {
type: 'bar',
label: 'A',

data: arraySE(AAA[1][2],2,100),
backgroundColor:'#4f81bc',
yAxisID: 'left'
}, ]
},
options: {
responsive: false,
//maintainAspectRatio: false,
title: {
display: true,
text: 'ABC                                     ',
fontSize: 8
},
legend: {
position: 'left'
},
animation: {
duration: 1000,
// easing: 'easeInElastic'
easing: 'easeOutBounce',
//onComplete :function() {alert(9)}
},
scales: {

xAxes: [{
stacked: true ,
gridLines: {
display: false
},
}],
yAxes: [{
id: 'left',
position: "left",
ticks: {stepSize: 50,min:0, max:300,},
stacked: true
},
{
id: 'right',
position: "right",
ticks: {stepSize: 80,min: 0,max:100},
}
]
},
tooltips:{
mode: 'index',
//mode: 'x',
intersect: false,
backgroundColor:'#393f635c', //#e5d8b0ba',
caretPadding:6,
yPadding:10,
xPadding:10,
titleFontSize:16,
titleFontColor:'black',
bodyFontColor:'#34495e',
bodyFontSize:14,
}



}

});
};


//function arraySE(Ary,St,En){
// var SE=[]
// for(var i=St;i< Ary.length && i<=En;i++){
// SE.push(Ary[i])
// }
// return SE
//}

2019年07月18日

Cht1




//function arraySE(Ary,St,En){
// var SE=[]
// for(var i=St;i続きを読む...
検索
<< 2020年01月 >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
最新記事
写真ギャラリー
最新コメント
タグクラウド
カテゴリーアーカイブ
日別アーカイブ
×

この広告は30日以上新しい記事の更新がないブログに表示されております。