嗨,所以我有一组要复制的数据。基本上我想创建一个 if 函数。如果我们在 B 列中搜索一个空白行并且它是空白的,则循环到下一行,并继续直到第一个非空白行。如果我们点击非空白复制列 c 中所有空白行中的所有单元格。
Sub NotReadys()
' NotReadys Macro'
Dim Z As Integer 'Supplier Beginning Row'
Dim X As Integer 'Next Non Blank row'
Dim Q As Integer '# of suppliers'
Dim Y As Integer 'Paste Row'
Y = 6
'For T = 1 To 195
ActiveWindow.SmallScroll Down:=-33
Range("B" & Y).Select
Selection.Copy
Range("E" & Y).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F" & Y).Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=TEXTJOIN(CHAR(10),FALSE,RC[-3]:R[30]C[-3])"
Range("F" & Y).Select
ActiveWindow.SmallScroll Down:=-30
Range("F" & Y).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Y = Y + 1
Next T
End Sub