如何获得当前单元格的值

wyf2 2005-12-17 04:48:54
怎么样获得datagrid控件当前单元格的值
...全文
217 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
daisy8675 2005-12-18
  • 打赏
  • 举报
回复
with me.datagrid1
.col=1
msgbox .text
.col=2
msgbox .text
end with



wyf2 2005-12-18
  • 打赏
  • 举报
回复
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
r = DataGrid1.Row
c = DataGrid1.Col
End Sub
为什么要这一段呀
northwolves 2005-12-18
  • 打赏
  • 举报
回复
Dim r As Integer, c As Integer, s As String


Private Sub DataGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
DataGrid1.Row = r
DataGrid1.Col = c
s = DataGrid1.Text
End If
End Sub

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
r = DataGrid1.Row
c = DataGrid1.Col
End Sub
还想懒够 2005-12-18
  • 打赏
  • 举报
回复
参考
http://community.csdn.net/Expert/topic/4249/4249097.xml?temp=.9923365
还想懒够 2005-12-18
  • 打赏
  • 举报
回复
Me.DataGrid1.Columns(列索引).CellText (Me.DataGrid1.GetBookmark(行代码))
Kelishating 2005-12-18
  • 打赏
  • 举报
回复
为什么不用Spread控件!功能要比DataGrid强大得多!
建议中...
wyf2 2005-12-18
  • 打赏
  • 举报
回复
我不是要指定获取那个单无格
我是要当我单击某个单元格时就获取那个单元格的内容,用来做复制功能的

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧