ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   selection.pastespecial problem (https://www.excelbanter.com/excel-programming/299943-selection-pastespecial-problem.html)

rleonard[_2_]

selection.pastespecial problem
 
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







Chris

selection.pastespecial problem
 
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








All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com