EXCEL 비정규 데이터를 드래그하여 방정식을 자동으로 채울 수 없는 스크립트 방법
dim row
dim colum, col
dim index
dim str, calStr, colLabel
dim colName
dim resRow, resCol
dim srcRow, srcCol
dim rngStr, rngStr1, rngStr2
dim indexArray, i
dim mainStr(407)
colName = "CDEFGHIJKLMNOPQR"
REM str = ""
REM for row = 14 to 246 step 1
REM for colum = 1 to 16 step 2
REM str = str&"="&mid(colName, colum, 1)&row&"+"&mid(colName, (colum+1),1)&row&"*256"&vbCrlf
REM next
REM next
REM calStr = ""
REM '=if((),(),()) &
REM for row = 900 to 949 step 1
REM for colum = 1 to 14 step 1
REM colLabel = mid(colName, colum, 1)& row
REM if(colum = 1)then
REM calStr = calStr & "="
REM End If
REM calStr = calStr & "if((HEX2DEC(" & colLabel & ")<>0), CHAR(HEX2DEC(" & colLabel & ")), " & chr(34) & chr(34) & ")" & " & "
REM next
REM calStr = mid(calStr, 1, Len(calStr)-3)
REM calStr = calStr & vbCrlf
REM next
calStr = ""
col = 13 ' "O"
srcRow = 218
indexArray = 0
For row = 1 To 400 Step 1
If col > 16 Then
col = 1
srcRow = srcRow + 1
End If
rngStr = Mid(colName, col, 1) & srcRow
mainStr(indexArray) = rngStr
indexArray = indexArray + 1
col = col + 1
Next
calStr = ""
colName = " YAGAO"
i = 0
for row = 219 to 251 step 2
calStr = calStr & "=HEX2DEC(" & mainStr(i) & ")+Hex2Dec(" & mainStr(i+1) & ")*256" & space(136-33) & _
"=Hex2Dec(" & mainStr(i+8) & ")+Hex2Dec(" & mainStr(i+9) & ")*256" & space(136-33) & _
"=Hex2Dec(" & mainStr(i+16) & ")+Hex2Dec(" & mainStr(i+17) & ")*256" & vbCrlf
calStr = calStr & "=" & chr(34) & "20" & chr(34) & " & HEX2DEC(" & mainStr(i+2) & ") & " & chr(34) & "-" & chr(34) & _
" & Hex2dec(" & mainStr(i+3) & ") & " & chr(34) & "-" & chr(34) & _
" & Hex2dec(" & mainStr(i+4) & ") & " & chr(34) & " " & chr(34) & _
" & Hex2dec(" & mainStr(i+5) & ") & " & chr(34) & ":" & chr(34) & _
" & Hex2dec(" & mainStr(i+6) & ") & " & chr(34) & ":" & chr(34) & _
" & Hex2dec(" & mainStr(i+7) & ") " & _
"=" & chr(34) & "20" & chr(34) & " & HEX2DEC(" & mainStr(i+10) & ") & " & chr(34) & "-" & chr(34) & _
" & Hex2dec(" & mainStr(i+11) & ") & " & chr(34) & "-" & chr(34) & _
" & Hex2dec(" & mainStr(i+12) & ") & " & chr(34) & " " & chr(34) & _
" & Hex2dec(" & mainStr(i+13) & ") & " & chr(34) & ":" & chr(34) & _
" & Hex2dec(" & mainStr(i+14) & ") & " & chr(34) & ":" & chr(34) & _
" & Hex2dec(" & mainStr(i+15) & ") " & _
"=" & chr(34) & "20" & chr(34) & " & HEX2DEC(" & mainStr(i+18) & ") & " & chr(34) & "-" & chr(34) & _
" & Hex2dec(" & mainStr(i+19) & ") & " & chr(34) & "-" & chr(34) & _
" & Hex2dec(" & mainStr(i+20) & ") & " & chr(34) & " " & chr(34) & _
" & Hex2dec(" & mainStr(i+21) & ") & " & chr(34) & ":" & chr(34) & _
" & Hex2dec(" & mainStr(i+22) & ") & " & chr(34) & ":" & chr(34) & _
" & Hex2dec(" & mainStr(i+23) & ")" & vbCrlf
i = i + 24
next
set fs=createobject("scripting.filesystemobject")
set f =fs.opentextfile("e:\text.txt",8)
f.writeblanklines(1)
f.writeline calStr
f.close
set f =nothing
set fs=nothing
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
C# EXCEL에서 워크시트를 읽는 것은 Sheet1과 같은 기본 이름이 아닙니다.텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.