设置EXCEL单元格????(急急急!!!)

xhfj 2006-02-24 04:47:51
如何将EXCEL的某单元设置左对齐或右对齐呢?????谢谢
...全文
183 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdngoodnight 2006-02-27
  • 打赏
  • 举报
回复
'改成这样就差不多了:
'定义个变量a,顶替 .... Range("F6") 这一串
With a
.HorizontalAlignment = xlLeft '左对齐
.VerticalAlignment = xlBottom '居下
'下面是些默认值,可以省略掉
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
lsftest 2006-02-24
  • 打赏
  • 举报
回复
vba代码:

Sub 宏1()
'
' 宏1 Macro
' Billgates 记录的宏 2006-2-24
'

'左对齐
Range("F6").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
'右对齐
Range("F7").Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
End Sub
northwolves 2006-02-24
  • 打赏
  • 举报
回复
点右键,设置单元格格式
KINGhjh 2006-02-24
  • 打赏
  • 举报
回复
掉用它里面的宏
faysky2 2006-02-24
  • 打赏
  • 举报
回复
自己录制宏,看宏代码吧:

打开Excel,在菜单的"工具"->"宏"->"录制新宏",然后开始对Excel操作,操作完了停止录制宏,在"宏"->"Visual Basic编辑器"->"模块"里的模块就有你录制的过程的代码
vbman2003 2006-02-24
  • 打赏
  • 举报
回复
这类问题太多了,搜索一下就可以了
或者在EXCEL中操作一下,录下宏,看一下模块中的代码

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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