合并单元格

Sub 宏1()
'
' 宏1 宏
'
' 快捷键: Ctrl+q
'
Application.Goto Reference:="宏1"
Application.VBE.MainWindow.Visible = True Application.DisplayAlerts = False For i = [A65536].End().Row To Step -
If Cells(i - , ) = Cells(i, ) Then
Cells(i - , ).HorizontalAlignment = xlCenter
Cells(i - , ).VerticalAlignment = xlCenter
Range(Cells(i - , ), Cells(i, )).Merge
End If
Next For i = [B65536].End().Row To Step -
If Cells(i - , ) = Cells(i, ) Then
flag = True
If (Cells(i, ) <> "") Then
flag = False
End If
If flag Then
Cells(i - , ).HorizontalAlignment = xlCenter
Cells(i - , ).VerticalAlignment = xlCenter
Range(Cells(i - , ), Cells(i, )).Merge
End If
End If
Next For i = [C65536].End().Row To Step -
If Cells(i - , ) = Cells(i, ) Then
flag = True
If (Cells(i, ) <> "") Then
flag = False
End If
If flag Then
Cells(i - , ).HorizontalAlignment = xlCenter
Cells(i - , ).VerticalAlignment = xlCenter
Range(Cells(i - , ), Cells(i, )).Merge
End If End If
Next Application.DisplayAlerts = True Application.VBE.MainWindow.Visible = False
End Sub

最新文章

  1. maven官方库中没有oracle jdbc驱动的问题解决
  2. (转)RVA-相对虚拟地址解释
  3. HashMap和HashSet
  4. laravel 中 与前端的一些事4 之合并压缩静态文件
  5. java执行时的两个常见问题(无法加载主类)
  6. java基础:数据类型
  7. 微软 Virtual studion Code
  8. POJ_2914_Minimum_Cut_(Stoer_Wagner)
  9. 用Ajax去读取服务器端的XML格式的数据
  10. Android开发之InstanceState详解(转)
  11. hdu 1258 DFS
  12. C++使用函数模板
  13. java读取properties 文件信息
  14. [置顶] 使用Android OpenGL ES 2.0绘图之五:添加运动
  15. spell checking
  16. message:GDI+ 中发生一般性错误。
  17. springboot 如何操作redis
  18. ecplise debug 无法命中断点 一直在加载中
  19. 【LOJ】#2567. 「APIO2016」划艇
  20. Website Develop: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

热门文章

  1. 8-MySQL-Ubuntu-数据表中数据的增加(一)
  2. 辞职信也要玩出高big
  3. Linux 进程间通信 消息队列
  4. linux 6 timezone修改
  5. nginx : OpenEvent Faied access is denied
  6. Yii2 : Active Record add Not In condition
  7. js数据访问的艺术
  8. CSS控制Span强制换行、溢出隐藏
  9. Java——面向对象的特征二:继承性
  10. android 签名生成和签名验证