[英]Repopulate Excel merged cells
I need to export a series of 5000 line excel documents to mySQL. 我需要将一系列5000行excel文档导出到mySQL。 The problem is the excel files have been merged repeatedly. 问题是excel文件已被反复合并。 (See link to screenshot: http://cgtest.forakergroup.com/images/excel.png ) (请参阅屏幕快照的链接: http : //cgtest.forakergroup.com/images/excel.png )
A1 CHARITY NUM AMT
+ A2 name 1 $100
| + A3 2 $105
| | A4 2 $105
| L A5 5 $105
L A6 5 $105
+ A7 name2 1 $100
| + A8 2 $105
| | A9 2 $105
| L A10 5 $105
L A11 5 $105
I need to insert the charity name (currently in A2) in each of the subsequent columns where it has been merged (A3, A4 etc.). 我需要在已合并(A3,A4等)的每个后续列中插入慈善名称(当前在A2中)。
Is there a function within excel that will repopulate merged cells? excel中是否有一个功能可以重新填充合并的单元格?
If you are requiring what I think you are then a function is not necessary (nor code). 如果您需要我认为的功能,那么就不需要功能(也不需要代码)。 Just select the relevant column, Home > Editing - Find & Select, Blanks, key =
, Up , Ctrl + Enter . 只需选择相关列,主页>编辑-查找和选择,空白,键=
, 向上 , 按Ctrl + Enter 。
The following macro will fill in all blanks as long as all the cells have been unmerged. 只要所有单元格都未合并,以下宏将填充所有空白。
Sub Fill_Empty()
Dim oRng As Range
Set oRng = Selection
Selection.Font.Bold = True
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Font.Bold = False
Selection.FormulaR1C1 = "=R[-1]C"
oRng.Copy
oRng.PasteSpecial Paste:=xlValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
Thanks to Levasseur for the suggestion to write a macro. 感谢Levasseur提出编写宏的建议。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.