Bonjour, tout le monde et bonne année.
Est-il possible d'adapter ce code à une feuille Excel. Merci
<html>
<body>
<form method="post">
<div align="center">
<div>
<table border="0" width="35%">
<tbody>
<tr>
<td width="20%"><span style="">Nm</span>1
<select id="bloc" size="1" name="T1">
</select> </td>
<td width="20%"><span style="">Nm</span>2
<select id="bloc" size="1" name="T2">
</select> </td>
<td width="20%"><span style="">Nm</span>3
<select id="bloc" size="1" name="T3">
</select> </td>
<td width="20%"><span style="">Nm</span>4
<select id="bloc" size="1" name="T4">
</select> </td>
<td width="20%" colspan="2">
<div align="center">
<div>
<p>
<input style="TEXT-TRANSFORM: uppercase; COLOR: #ff0000; FONT-WEIGHT: bold; TEXT-DECORATION: blink" value="GOO" type="submit" name="B1" /></p></div></div></td>
</tr>
<%
Server.ScriptTimeOut = 1500
if request.form("B1") <> "" Then
count = 0
bloc1=request.form("T1")
if bloc1 <> "" Then count = count + 1
bloc2=request.form("T2")
if bloc2 <> "" Then count = count + 1
bloc3=request.form("T3")
if bloc3 <> "" Then count = count + 1
bloc4=request.form("T4")
if bloc4 <> "" Then count = count + 1
bloc5=request.form("T5")
if bloc5 <> "" Then count = count + 1
bloc6=request.form("T6")
if bloc6 <> "" Then count = count + 1
Set RS = Server.CreateObject("ADODB.Recordset")
sql = "Select * From Feuil1"
rs.Open sql, conn, 3, 3
rs.movefirst
do while not rs.eof
test = 0
if rs(1) <> "*" Then
for j = 1 to 5
if j = 1 Then
bloc = bloc1
elseif j = 2 Then
bloc = bloc2
elseif j = 3 Then
bloc = bloc3
elseif j = 4 Then
bloc = bloc4
elseif j = 5 Then
bloc = bloc5
end if
for i = 1 to 5
if rs(i) = bloc then
test = test + 1
end if
next
next
if (test = count) and count <> 0 then
m = m+ 1
rs(1) = "*"
rs(2) = "*"
rs(3) = "*"
rs(4) = "*"
rs(5) = "*"
rs.update
end if
end if
rs.movenext
loop
End If
response.write m
%>
</tbody>
</table></div></div>
</form>
</body>
</html>
Est-il possible d'adapter ce code à une feuille Excel. Merci
<html>
<body>
<form method="post">
<div align="center">
<div>
<table border="0" width="35%">
<tbody>
<tr>
<td width="20%"><span style="">Nm</span>1
<select id="bloc" size="1" name="T1">
</select> </td>
<td width="20%"><span style="">Nm</span>2
<select id="bloc" size="1" name="T2">
</select> </td>
<td width="20%"><span style="">Nm</span>3
<select id="bloc" size="1" name="T3">
</select> </td>
<td width="20%"><span style="">Nm</span>4
<select id="bloc" size="1" name="T4">
</select> </td>
<td width="20%" colspan="2">
<div align="center">
<div>
<p>
<input style="TEXT-TRANSFORM: uppercase; COLOR: #ff0000; FONT-WEIGHT: bold; TEXT-DECORATION: blink" value="GOO" type="submit" name="B1" /></p></div></div></td>
</tr>
<%
Server.ScriptTimeOut = 1500
if request.form("B1") <> "" Then
count = 0
bloc1=request.form("T1")
if bloc1 <> "" Then count = count + 1
bloc2=request.form("T2")
if bloc2 <> "" Then count = count + 1
bloc3=request.form("T3")
if bloc3 <> "" Then count = count + 1
bloc4=request.form("T4")
if bloc4 <> "" Then count = count + 1
bloc5=request.form("T5")
if bloc5 <> "" Then count = count + 1
bloc6=request.form("T6")
if bloc6 <> "" Then count = count + 1
Set RS = Server.CreateObject("ADODB.Recordset")
sql = "Select * From Feuil1"
rs.Open sql, conn, 3, 3
rs.movefirst
do while not rs.eof
test = 0
if rs(1) <> "*" Then
for j = 1 to 5
if j = 1 Then
bloc = bloc1
elseif j = 2 Then
bloc = bloc2
elseif j = 3 Then
bloc = bloc3
elseif j = 4 Then
bloc = bloc4
elseif j = 5 Then
bloc = bloc5
end if
for i = 1 to 5
if rs(i) = bloc then
test = test + 1
end if
next
next
if (test = count) and count <> 0 then
m = m+ 1
rs(1) = "*"
rs(2) = "*"
rs(3) = "*"
rs(4) = "*"
rs(5) = "*"
rs.update
end if
end if
rs.movenext
loop
End If
response.write m
%>
</tbody>
</table></div></div>
</form>
</body>
</html>