Home > Software engineering >  Pray god to help write a VBA
Pray god to help write a VBA

Time:09-18

I'll in table B copy what I need to cut version
Then I a macro content automatically paste into a table, if a table contains A1 list of content will continue to determine down, judge to paste in without content

CodePudding user response:

Taobao to do it

CodePudding user response:

In table B before me copy what I need to shear edition, this is copied by hand? Don't have to code,,

Then I a macro content automatically paste into a table, if a table contains A1 list of content will continue to determine down, judgment is not content to paste into, is pasted into a column in the first empty cell?

CodePudding user response:

In table B before me copy what I need to shear edition, this is copied by hand? Don't have to code,,

Then I a macro content automatically paste into a table, if a table contains A1 list of content will continue to determine down, judgment is not content to paste into, is pasted into a column in the first empty cell?

CodePudding user response:

reference dsd999 reply: 3/f
in table B before me copy what I need to shear edition, this is copied by hand? Don't have to code,,

Then I a macro content automatically paste into a table, if a table contains A1 list of content will continue to determine down, judgment is not content to paste into, is pasted into a column in the first empty cell?

Yes yes, it is a great god

CodePudding user response:

The
reference 4 floor syun2005 reply:
that's easy,,,,,,,

Just contact is unlikely to help write a piece of code

CodePudding user response:

Can I ask you have you going to do, why the line is copied to the clipboard, why not directly copied to want,

CodePudding user response:

Or do you just say what you want to achieve purpose, I can help you finish sent to you

CodePudding user response:

Sub macro (1)
Last_row=Worksheets (" A table "). The Range (" a1048576 "). The End (xlUp). Row
Worksheets (" A table "). Paste Destination:=Range (" A "& amp; Last_row + 1)
End Sub

CodePudding user response:

Why I copy numerical paste A1 to A3 A5 A7 A9 recording is complete, Dim I write code As long
For I=2 To 1000 end add Next To execute in its 1000 bar why it always bar A3A5A7A9 in execution?

CodePudding user response:

references to the tenth floor pugai888 response:
why I copy numerical paste A1 to A3 A5 A7 A9 recording is complete, Dim I write code As long
For I=2 To 1000 end add Next To execute in its 1000 bar why it always bar A3A5A7A9 in execution?

Your code "logic problem" bai...
The "record" code, you need to "understand", and then modified according to your demand,

If you directly to the code embedded in a For loop, it must be kept before your "paste" is repeated N times,

CodePudding user response:

According to your requirements to write the code, only supplies the reference:
1. Insert the sheet1 page a ActiveX button

2. Enter the following code
 
Private Sub CommandButton1_Click ()
Dim As Integer I

If Selection. Cells. Count & gt;=1 Then
Selection. Copy
End the If

For I=1 To Sheet2. Range (" a65533 "). The End (xlUp). Row + 1
If Sheet2. Cells (I, 1)="" Then
Sheet2. Cells (I, 1). PasteSpecial xlPasteAll
GoTo Finish
End the If
Next I

Finish:
End Sub

3. The selected area point in sheet1 page button, will be copied to sheet2
  •  Tags:  
  • VBA
  • Related