when I copy the table as picture, another one is creating from the same table, using VBA macro

Sna

New Member
Joined
Nov 11, 2023
Messages
2
Office Version
  1. 2021
Platform
  1. Windows
guys i made a macro in excel i want to copy the table when i run this macro the table area duplicating itself please help me, thanks

VBA Code:
Sub screenshot()
Dim w As Worksheet
    Range("D1:F7").Select
    Selection.Copy
    Range("C4").Select
    ActiveSheet.Pictures.Paste.Select 'when i remove this it wont recreate the table but now my clipboard is getting empty

    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = ""
    
End Sub
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
What are you trying to do ?
Currently it is creating a picture of the table which is exactly what that code is intended to do and which your heading indicates that you want.
 
Upvote 0
What are you trying to do ?
Currently it is creating a picture of the table which is exactly what that code is intended to do and which your heading indicates that you want.
VBA Code:
Private Sub CommandButton1_Click()
Call screenshot
last = Cells(Rows.Count, "A").End(3).Row
Selection.Copy


ActiveWorkbook.FollowHyperlink Address:=" https://web.whatsapp.com/send?phone=" & Cells(2, 1) & "&text=" & Cells(2, 2)

Application.Wait Now + TimeValue("00:00:20")

Call SendKeys("^v")

Application.Wait Now + TimeValue("00:00:07")

Call SendKeys("{ENTER}", True)
Application.Wait Now + TimeValue("00:00:07")


Call SendKeys("{ENTER}", True)
SendKeys String:="^w{enter}", Wait:=True
Application.Wait Now + TimeValue("00:00:07")

End Sub

i made a macro when i click the button it will automatically send it to whatsapp it calls "screenshot" there but the problem is when i call this screenshot thing it creates the table inside the project like this
this one is normal but when i call this script it became like this, so i dont want it do paste the picture to the tables like in second photo
1699703027111.png
1699703117826.png
 
Upvote 0
You might be better off starting to new thread making it clear that you are trying copy either the table or a picture of the table (clarify which one) into a WhatsApp message.
Provide all the code you have above.
I can't help you with that.
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,963
Members
449,094
Latest member
Anshu121

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