command button to move data

D

dummy

If it's possible, I would like to use a command button or checkbox to
trigger moving data from cells in a column (b34-b41) on one worksheet to the
next available ROW on another worksheet.
Thanks in advance.
 
B

Bill Kuunders

use the macro below and assign it to any picture or text box

Sub Macro1()

Sheets("Sheet1").Select
Range("B34:B41").Select
Selection.Copy

Sheets("Sheet2").Select
Range("A65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True

Sheets("Sheet1").Select
Range("B34:B41").Select
Application.CutCopyMode = False
Selection.ClearContents

End Sub
 
D

dummy

Bill Kuunders said:
use the macro below and assign it to any picture or text box

Sub Macro1()

Sheets("Sheet1").Select
Range("B34:B41").Select
Selection.Copy

Sheets("Sheet2").Select
Range("A65536").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True

Sheets("Sheet1").Select
Range("B34:B41").Select
Application.CutCopyMode = False
Selection.ClearContents

End Sub




.
I am getting a syntax error which is highlighting the pastespecial portion of the code.
 
B

Bill Kuunders

Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= False, Transpose:=True

all of this needs to be on one line. without the underscore _

Regards
Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top