'//=========================//
'// タグを処理する //
'//=========================//
Function chgTagToStr(tag As String, next_str_pos As Integer, shname As String) As Integer
If (Mid(tag, 1, 6) = "REPEND") Then
lpgyo = lpgyo + 1
cellpos = Replace(Mid(tag, 7), " ", "") & CStr(lpgyo)
celldata = Sheets(shname).Range(cellpos)
If (celldata = "") Then
chgTagToStr = next_str_pos
Else
chgTagToStr = lpstr_pos
End If
Exit Function
End If
If (Mid(tag, 1, 3) = "REP") Then
lpstr_pos = next_str_pos
lpgyo = CInt(Replace(Mid(tag, 4), " ", ""))
chgTagToStr = next_str_pos
Exit Function
End If
If (Mid(tag, 1, 4) = "CELL") Then
cellpos = Replace(Mid(tag, 5), " ", "")
celldata = Sheets(shname).Range(cellpos)
If (no_out_flg = 0) Then
outdata = outdata & celldata
End If
chgTagToStr = next_str_pos
Exit Function
End If
If (Mid(tag, 1, 4) = "KETA") Then
cellpos = Replace(Mid(tag, 5), " ", "") & CStr(lpgyo)
celldata = Sheets(shname).Range(cellpos)
If (no_out_flg = 0) Then
outdata = outdata & celldata
End If
chgTagToStr = next_str_pos
Exit Function
End If
If (Mid(tag, 1, 6) = "IFKETA") Then
kugiri_pos = InStr(7, tag, ",")
cellpos = Replace(Mid(tag, 7, kugiri_pos - 7), " ", "") & CStr(lpgyo)
celldata = Sheets(shname).Range(cellpos)
chkdata = Mid(tag, kugiri_pos + 1)
If (celldata = chkdata) Then
no_out_flg = 0
Else
no_out_flg = 1
End If
chgTagToStr = next_str_pos
Exit Function
End If
If (Mid(tag, 1, 6) = "IFCELL") Then
kugiri_pos = InStr(7, tag, ",")
cellpos = Replace(Mid(tag, 7, kugiri_pos - 7), " ", "")
celldata = Sheets(shname).Range(cellpos)
chkdata = Mid(tag, kugiri_pos + 1)
If (celldata = chkdata) Then
no_out_flg = 0
Else
no_out_flg = 1
End If
chgTagToStr = next_str_pos
Exit Function
End If
If (Mid(tag, 1, 5) = "IFEND") Then
no_out_flg = 0
chgTagToStr = next_str_pos
Exit Function
End If
chgTagToStr = next_str_pos
End Function
|