selection.pastespecial problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What do I have to change in following code to allow macro to paste copied data at cell range selected via
application.msgbox code displayed below

MsgBox "From GoTo Box, Select 'Sub Data' To Copy
Application.Dialogs(xlDialogFormulaGoto).Sho
Selection.Cop

MsgBox "From GoTo Box, Select 'GROUP' to Copy Sub Data to
Application.Dialogs(xlDialogFormulaGoto).Sho

Dim ret_value As Rang
Set ret_value = Application.InputBox("select a range in Group", Type:=8
Application.Goto reference:=ret_value ' I added this line of code to display starting cell of range I had selected w/inputbox
ActiveCell.Activate ' I added this line of code, hoping it would make cell selected work w/selection paste special

ans = MsgBox(" Is this correct cell to enter Sub Score", vbYesNo)
If ans = vbNo Then _
Exit Sub
' Above code appears to work, but I receive error msg with following paste special code!

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

The code i am pasting is 4 cell wide ex

col a col b col c col
sub01 joe blow 50 4

thanks again for your hel
Bob Leonar
(e-mail address removed)
 
Your Inputbox is clearing the clipboard! Paste from 'To Copy' to 'Copy to' directly without having to choose a sub-range in betwee

----- rleonard wrote: ----

What do I have to change in following code to allow macro to paste copied data at cell range selected via
application.msgbox code displayed below


MsgBox "From GoTo Box, Select 'Sub Data' To Copy
Application.Dialogs(xlDialogFormulaGoto).Sho
Selection.Cop

MsgBox "From GoTo Box, Select 'GROUP' to Copy Sub Data to
Application.Dialogs(xlDialogFormulaGoto).Sho

Dim ret_value As Rang
Set ret_value = Application.InputBox("select a range in Group", Type:=8
Application.Goto reference:=ret_value ' I added this line of code to display starting cell of range I had selected w/inputbox
ActiveCell.Activate ' I added this line of code, hoping it would make cell selected work w/selection paste special

ans = MsgBox(" Is this correct cell to enter Sub Score", vbYesNo)
If ans = vbNo Then _
Exit Sub
' Above code appears to work, but I receive error msg with following paste special code!

Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

The code i am pasting is 4 cell wide ex

col a col b col c col
sub01 joe blow 50 4

thanks again for your hel
Bob Leonar
(e-mail address removed)
 

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

Back
Top