VBA code to copy values from specific cells to clipboard

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,237
Office Version
  1. 2007
Platform
  1. Windows
Afternoon.

I wish to be ablue to copy some cell values to the clipboard.

Currntly i have this data as an exmple.
Cell E5 value 1
Cell F5 value 2
Cell G5 value A
Cell H5 value R
Cell I5 value 2
Cell J5 value P

When my selected url is open i will then select a field on the page & paste expecting the values 12AR2P to be pasted.

Below is the end of my code in use.
I select ok to a message box.
Taken to the worksheet called PRINT LABELS
Cell A1 is selected
Cell values are copied
My url is then open
I then paste.

Rich (BB code):
MsgBox "The Codes Were Transfered Sucessfully ", vbInformation, "Sucessful Transfer"

With Sheets("PRINT LABELS")
.Activate
.Range("A1").Select
CODE REQUEST WILL GO HERE
ActiveWorkbook.FollowHyperlink Address:="http://www.reeves.tv/mini.html"
End With

End Sub
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Ive managed this below,

Rich (BB code):
MsgBox "The Codes Were Transfered Sucessfully ", vbInformation, "Sucessful Transfer"

With Sheets("PRINT LABELS")
.Activate
Dim ws As Worksheet: Set ws = ThisWorkbook.Worksheets("PRINT LABELS")
ws.Range("E5:F5,G5,H5,I5,J5").Copy
.Range("A1").Select
ActiveWorkbook.FollowHyperlink Address:="http://www.reeves.tv/mini.html"
End With

End Sub

This when pasted in shows like 1 2 A R 2 P as opposed to 12AR2P
Also when i return to the working sheet i have flashing dotted lines around the cells in question E5:J5
 
Upvote 0
how about
=CONCATENATE(E5,F5,G5,H5,I5,J5) in another cell and copying that ?

you can stop the "marching ants" with
Application.CutCopyMode = False
but that clears it from the clipboard
 
Upvote 0
Hi,
Ive put that code in cell AE1

My code is like this now.

Rich (BB code):
        .Range("M1").ClearContents
        For Each currentShape In .Shapes
            If currentShape.Type = msoPicture Then
                currentShape.Delete
            End If
        Next currentShape
    End With
    
    Application.ScreenUpdating = True
    
ActiveWorkbook.Save
End If
MsgBox "The Codes Were Transfered Sucessfully ", vbInformation, "Sucessful Transfer"

With Sheets("PRINT LABELS")
.Activate
.Range("A1").Select
ActiveWorkbook.FollowHyperlink Address:="http://www.reeves.tv/mini.html"
End With

End Sub

After the url is open i click in the field but there is no paste option
Trying to paste it into a cell on the worksheet also doesnt give me a paste option.
There is no marching ants either.

What did i do wrong ?
 
Upvote 0
Yep,

Now i have this which pastes fine.
After i have pasted i come back to the worksheet,it is now i wish to stop the marching ants in cell AE1 where i copied the value.

Can you advise please.
 
Upvote 0
I did read that but not sure how i apply it.
I copy the cell value from AE1
Url is open & i pqaste the value.
I return to the worksheet & need to stop thos ants.
My work is now done untill i start the same process over again
 
Upvote 0

Forum statistics

Threads
1,215,660
Messages
6,126,085
Members
449,287
Latest member
lulu840

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top