简体   繁体   English

如何在列中复制一个单元格数据,然后将其粘贴,直到另一个值通过 VBA 进入列中?

[英]How can i copy one cell data in a column and then paste it untill another value comes in the column through VBA?

The code I used我使用的代码

Sub copypaste()
'
' copypaste Macro
'

'
    Range("B2:B8").Select
    Application.CutCopyMode = False
    Selection.FillDown
    Range("B9:B10").Select
    Selection.FillDown
    Range("B11:B13").Select
    Selection.FillDown
End Sub

I have this sheet:我有这张表:

在此处输入图像描述

And I want output through VBA code as my actual sheet is very big like this:我想要 output 到 VBA 代码,因为我的实际工作表非常大,如下所示:

在此处输入图像描述

Avoid VBA in case you not sure how to use it in the first place.避免 VBA 以防您一开始就不确定如何使用它。 There are many cool build-in features to assist you in a case like yours:在像您这样的情况下,有许多很酷的内置功能可以帮助您:

  • Select range B1:B17 Select 范围B1:B17
  • Goto tab Start > Select Find & Select > Choose Go To Special > Choose Blanks转到选项卡Start > Select Find & Select > 选择Go To Special > 选择Blanks
  • Now all empty cells in your range are selected with cursor in top one.现在,您范围内的所有空单元格都被选中,其中 cursor 在顶部。 Type =B2 and hit key-combo Ctrl + Enter键入=B2并按组合键Ctrl + Enter

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将一列动态数据(作为值)复制并粘贴到 VBA 中的另一列? - How to copy and paste a column of dynamic data (as values) to another column in VBA? 如何使用VBA比较列中每个单元格中的数据,在下一列中复制单元格的值并粘贴到其他电子表格中? - How to compare data in each cell in columns using VBA, copy value of cells in next column and paste in different spreadsheet? VBA-如何将列中的最后一个值复制并粘贴到另一个工作表 - VBA - How to Copy and Paste the last value in a column to another Sheet 如何使用vba将多列数据从一张工作表复制并粘贴到另一张工作表 - How to copy and paste multiple column data from one sheet to another sheet using vba VBA 将一列的单元格值以数值 (MMDD) 开头的数据行复制到另一个工作表 - VBA Copy rows of data where cell value of one column begins with numeric value (MMDD) to another worksheet Excel VBA从列复制值并将值粘贴到单元格中 - excel vba copy value from a column and paste value in a cell VBA:检查一个单元格是否包含某个值以及如何将该值复制/粘贴到另一个单元格 - VBA: Check if one cell contains some value and how to copy/paste that value to another cell vba 查找值然后将另一个粘贴到另一列的不同单元格中 - vba find value then paste another into different cell in another column 如何使用 VBA 将过滤后的表从一列复制并粘贴到另一列可见列? - How to copy and paste a filtered table using VBA from one column to another visible column? VBA复制特定的单元格并粘贴到相邻列中 - VBA to copy a specific cell and paste into adjacent column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM