Excel精英培训网

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

VBA80第13集练习题上交专贴:单元格信息返回

  [复制链接]
发表于 2011-11-8 15:19 | 显示全部楼层
Sub 第一题()
Dim aa1 As Byte, aa2 As Byte
aa1 = Range("c4").CurrentRegion.Rows.Count
aa2 = Range("c4").CurrentRegion.Columns.Count
Range("a1") = Range("c4").CurrentRegion.Range("a1").Offset(aa1 - 1, aa2 - 1).Address(0, 0)
End Sub
Sub 第二题()
Dim a As Integer, b As Integer, c As Integer
With Range("d3")
a = .Top
b = .Left
c = .Width
d = .Height
End With

Range("f3").Comment.Shape.Select
With Selection
.Left = b + c
.Top = a
End With
End Sub
回复

使用道具 举报

发表于 2011-11-10 10:54 | 显示全部楼层
Sub e1()
With Range("c4").CurrentRegion
[F3] = .SpecialCells(xlCellTypeLastCell).Address(0, 0)
End With
End Sub

Sub e2()
Range("f3").Comment.Shape.Left = Application.WorksheetFunction.Sum(Range("d3").Left, range("d3").Width)
Range("f3").Comment.Shape.Top = Range("d3").Top
End Sub
回复

使用道具 举报

发表于 2011-11-12 19:43 | 显示全部楼层
回复

使用道具 举报

发表于 2011-11-17 10:00 | 显示全部楼层
游客,如果您要查看本帖隐藏内容请回复

见附件

第13集练习题-davidwance.rar

8.5 KB, 下载次数: 3

回复

使用道具 举报

发表于 2011-11-17 21:20 | 显示全部楼层
看看大家和我的方法有没不同
回复

使用道具 举报

发表于 2011-11-17 21:24 | 显示全部楼层
Sub 第一题()
   Dim x As Integer, y As Integer
   x = Range("c4").CurrentRegion.Rows.Count
   y = Range("c4").CurrentRegion.Columns.Count
   Range("a1") = Range("c4").CurrentRegion.Cells(x, y).Address(0, 0)
End Sub


Sub 第二题()
Dim x As Integer
   Range("f3").Comment.Shape.Left = Range("d:d").Width + Range("d:d").Left
End Sub
回复

使用道具 举报

发表于 2011-11-27 18:58 | 显示全部楼层
游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

发表于 2011-11-30 21:52 | 显示全部楼层
check the ans~~~~
回复

使用道具 举报

发表于 2011-12-4 23:07 | 显示全部楼层
学习学习。。。。。
回复

使用道具 举报

发表于 2011-12-12 17:09 | 显示全部楼层
[hide]Sub 练习1()
Dim x As String, y As String
With Range("c4").CurrentRegion
[f1] = .Rows.Count
[f2] = .Columns.Count
[f3] = .Cells([f1].Value, [f2].Value).Address(0, 0)
End With
End Sub


Sub 练习2()
With Range("f3")
[a1] = .Comment.Shape.Top
[a2] = .Comment.Shape.Left
End With
With Range("e3")
[a3] = .Top
[a4] = .Left
End With
[a5] = [a3] - [a1]
[a6] = [a4] - [a2]
Range("f3").Comment.Shape.IncrementLeft [a6].Value
Range("f3").Comment.Shape.IncrementTop [a5].Value
End Sub
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-18 22:19 , Processed in 0.334638 second(s), 8 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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