兰色幻想 发表于 2012-4-1 19:55

已结束:抢答2(2012-4-1)

本帖最后由 兰色幻想 于 2012-4-1 20:53 编辑

具体要求看附件内,本贴为回复可见。可以直接提交答案。提交答案时请把附件一并提交。
   奖励前10名,分别奖励10~1个积分
   

zhouyunj 发表于 2012-4-1 20:00

做题 中,:)哈哈沙发!

ls 发表于 2012-4-1 20:09

本帖最后由 ls 于 2012-4-1 20:20 编辑

Sub 清空()
Range("i2:i8").Clear
End Sub
Sub 查找月份()
For x = 2 To 7
Range("i" & x) = Range("i" & x).End(xlToLeft).End(xlUp).End(xlUp).End(xlUp)
Next
End Sub


yl_li 发表于 2012-4-1 20:13

B19-yl_li
Sub 查找月份()
Dim i As Integer
Dim j As Integer
    For i = 2 To 7
      j = Range("i" & i).End(xlToLeft).Column
      Range("i" & i).Value = Cells(1, j)
    Next i
End Sub
Sub 清空()
    Range("i2:i7").ClearContents
End Sub

chenzhi_juan 发表于 2012-4-1 20:17

Option Explicit

Sub pd()

Dim lastrow As Long

Dim x As Integer, y As Integer

lastrow = Range("a" & Cells.Rows.Count).End(xlUp).Row

For x = 2 To lastrow

For y = 8 To 2 Step -1

   If Cells(x, y) <> "" Then
   
       Cells(x, "i") = Cells(1, y)
      
       Exit For
      
   End If
   
   Next y
   
   Next x


End Sub


校长,太慢了,打不开附件按钮。迟点再发,抢位要紧

chenzhi_juan 发表于 2012-4-1 20:18

校长,迟了,不好意思,现在上传附件。
Option Explicit

Sub pd()

Dim lastrow As Long

Dim x As Integer, y As Integer

lastrow = Range("a" & Cells.Rows.Count).End(xlUp).Row

For x = 2 To lastrow

For y = 8 To 2 Step -1

   If Cells(x, y) <> "" Then
   
       Cells(x, "i") = Cells(1, y)
      
       Exit For
      
   End If
   
   Next y
   
   Next x


End Sub

byhdch 发表于 2012-4-1 20:20

本帖最后由 byhdch 于 2012-4-1 20:21 编辑

A09:byhdch

Sub 查找月份()
Dim i As Integer, j As Integer
For i = 2 To 7
If Cells(i, "I") = "" Then
      j = Cells(i, "I").End(xlToLeft).Column
    Else
      Cells(i, "I").Select
    End If
   Cells(i, "I") = Cells(i, j).Offset(-i + 1, 0).Value
    Next i
End Sub

wuhairong2011 发表于 2012-4-1 20:21

本帖最后由 wuhairong2011 于 2012-4-1 20:35 编辑

C15:wuhairong2011
Sub 查找月份()
Dim x As Integer
For x = 2 To 7
    If Cells(x, "H") > 1 Then
      Cells(x, "I") = "7月"
    Else
      Cells(x, "I") = Range("H" & x).End(xlToLeft).Column - 1 & "月"
    End If
Next x

End Sub

tcn541 发表于 2012-4-1 20:24

本帖最后由 tcn541 于 2012-4-1 20:25 编辑

Private Sub CommandButton1_Click()
Dim x As Integer
For x = 2 To 7
If Cells(x, "h") > 0 Then
   Cells(x, "i") = "7月"
   Else
    Cells(x, "i") = Range("h" & x).End(xlToLeft).Column - 1 & "月"
    End If
Next x
End Sub

hactnet 发表于 2012-4-1 20:24

本帖最后由 hactnet 于 2012-4-1 20:37 编辑

H组:hactnet

Private Sub CommandButton1_Click()
Range("i2:i7").ClearContents
End Sub
Private Sub CommandButton2_Click()
Dim x As Integer
For x = 2 To 10 Step 1
    Range("i" & x) = Range("i" & x).End(xlToRight).Value
Next x
End Sub

页: [1] 2 3
查看完整版本: 已结束:抢答2(2012-4-1)