Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
楼主: 兰色幻想

[练习题] 已结束:抢答2(2012-4-1)

  [复制链接]
发表于 2012-4-1 20:32 | 显示全部楼层
  1. Sub 查找月份()
  2. Dim i%, j%
  3. For i = 2 To 7
  4.    For j = 8 To 2 Step -1
  5.     If Cells(i, j) <> "" Then
  6.     Cells(i, 9) = Cells(1, j)
  7.     Exit For
  8.     End If
  9.    Next j
  10. Next i
  11.   
  12. End Sub

  13. Sub 清空()
  14.     Range("I2:I7").Select
  15.     Selection.ClearContents
  16. End Sub
复制代码
A 组长:wenchduan

抢2.rar

7.76 KB, 下载次数: 2

点评

方法有点笨,+4分  发表于 2012-4-1 20:49

评分

参与人数 1 +4 金币 +4 收起 理由
兰色幻想 + 4 + 4

查看全部评分

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
回复

使用道具 举报

发表于 2012-4-1 20:36 | 显示全部楼层
c10: CHRISSHA
抢2.rar (7.16 KB, 下载次数: 14)

点评

正确 +3分  发表于 2012-4-1 20:51

评分

参与人数 1 +3 金币 +3 收起 理由
兰色幻想 + 3 + 3 赞一个!

查看全部评分

回复

使用道具 举报

发表于 2012-4-1 20:36 | 显示全部楼层
C12:hrpotter
  1. Sub 查找()
  2.     Dim i As Byte, j As Byte
  3.     For i = 2 To 7
  4.         j = Cells(i, "i").End(xlToLeft).Column
  5.         Cells(i, "i") = Cells(1, j).Value
  6.     Next
  7. End Sub
  8. Sub 清空()
  9.     Range("i2:i7").ClearContents
  10. End Sub
复制代码
C12-hrpotter-抢2.rar (11.27 KB, 下载次数: 2)

点评

正确,+2分  发表于 2012-4-1 20:51

评分

参与人数 1 +2 金币 +2 收起 理由
兰色幻想 + 2 + 2 赞一个!

查看全部评分

回复

使用道具 举报

发表于 2012-4-1 20:37 | 显示全部楼层
E05:linch92413
Private Sub CommandButton1_Click()
   Dim R As Integer, i As Integer
   R = Range("a65536").End(xlUp).Row
   For i = 2 To R
      Cells(i, 9) = Application.Intersect(Rows(1), Cells(i, 10).End(xlToLeft).EntireColumn)
   Next i
End Sub
抢2(linch92413).rar (11.41 KB, 下载次数: 17)

点评

正确 +1分  发表于 2012-4-1 20:52

评分

参与人数 1 +1 金币 +1 收起 理由
兰色幻想 + 1 + 1

查看全部评分

回复

使用道具 举报

发表于 2012-4-1 20:38 | 显示全部楼层
Sub qing()
    Range("i2:i7").ClearContents
End Sub

Sub chazhao()
    Dim x As Integer
    Dim y As Integer
    For x = 7 To 2 Step -1
        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
A06 梅一枝 02.rar (7.89 KB, 下载次数: 4)
回复

使用道具 举报

发表于 2012-4-1 20:39 | 显示全部楼层
D15兰江自由鱼_抢2.rar (11.7 KB, 下载次数: 2)
回复

使用道具 举报

发表于 2012-4-1 20:40 | 显示全部楼层
已完成了,请老师批阅,谢谢!

抢2_zhouyunj.rar

11.45 KB, 下载次数: 2

已完成,谢谢!

回复

使用道具 举报

发表于 2012-4-1 20:43 | 显示全部楼层
Sub zh()
Dim m, n As Integer
For m = 2 To 7
For n = 7 To 1 Step -1
  If Cells(m, n + 1) <> "" Then
  Cells(m, 9) = n & "月"
  Exit For
  End If
  Next n
  Next m
End Sub

抢2.rar

7.03 KB, 下载次数: 2

回复

使用道具 举报

发表于 2012-4-1 20:44 | 显示全部楼层
本帖最后由 shengxudong 于 2012-4-1 21:35 编辑

Sub 清空()
Range("i:i").Select

Selection.ClearContents
Range("a1").Activate
End Sub
Sub 查找月份()
Dim x As Integer
Dim y  As Integer
Dim yue As String
For x = 2 To 7
    For y = 2 To 8
       If Cells(x, y).Value > 0 Then
           yue = Cells(1, y).Value
       End If
    Next y
    Cells(x, y).Value = yue
Next x
End Sub

抢2.rar

11.33 KB, 下载次数: 2

抢2.rar

10.71 KB, 下载次数: 2

回复

使用道具 举报

发表于 2012-4-1 20:45 | 显示全部楼层
Sub cmd()
    Dim LRn As Integer
    Dim i As Integer
    Dim j As Integer
    With Sheet2
        For i = 2 To .Range("a65535").End(xlUp).Row
            For j = 7 To 1 Step -1
                If .Cells(i, j + 1) <> "" Then
                    .Range("I" & i) = .Cells(1, j + 1)
                    Exit For
                End If
            Next j
        Next i
    End With
End Sub

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-5 03:45 , Processed in 0.302218 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表