VBA-Excel: Storing multiple data In the Windows Clipboard

In earlier sessions  you saw how to put text in the windows clipboard (Putting Text In The Windows Clipboard) with the help of PutInClipboard() and Data Object and how to get the text from the Clipboard using GetFromClipboard() and Data Object.

In this session you will learn how to store multiple data’s in Clipboard and retrieve them. For storing multiple data’s, you need to store values as pair, Keys and Values or you can say format identifier and while retrieving the data from the Clipboard you will use these format identifiers to get the data. This data can be String, Long, Integer.

For storing multiple data in Clipboard, Follow the below steps.

Read moreVBA-Excel: Storing multiple data In the Windows Clipboard

VBA-Excel: Get Text from the Windows Clipboard

In earlier session you saw how to put text in the windows clipboard(Putting Text In The Windows Clipboard) using PutInClipboard() and Data Object. In this session you will learn how to get the text from the clipboard.

For Getting the text from the Clipboard, Follow the below steps.

Steps:

  •         Initialize the Data Object, the type of MSForms.DataObject
  •         Get the text from the clipboard using Data Object
  •         Get the text out of Data Object using GetText() method.

Read moreVBA-Excel: Get Text from the Windows Clipboard

VBA-Excel: Putting Text In The Windows Clipboard

For working with Windows Clipboard you need DataObject, the object in MSForms library. It provides support for text-string.
For that you must add the reference “Microsoft Forms 2.0 Object Library”
How to add “Microsoft Forms 2.0 Object Library”
Now, For putting text in the Clipboard, Follow the below steps.
Steps:
•    Initialize the Data Object, the type of MSForms.DataObject
•    Create a String
•    Set the String into Data Object using SetText() method.
•    Put the data in ClipBoard using PutInClipboard

Read moreVBA-Excel: Putting Text In The Windows Clipboard

VBA-Excel: Copy/Paste data – Copy the Entire data from one sheet to another

In VBA-Excel, Copy and paste the data plays an important role, we can copy data from one place and paste it at some other place in the same way like how we do it manually, and when you copy some data its goes to the Clipboard from there you can paste it at some other location.

Dim mainworkBook As Workbook

Set mainworkBook = ActiveWorkbook

Copy  the Entire data from one sheet to another

For example if you want to copy the data “Sheet1” and paste it to in “Sheet2”.

For copy the data present in “Sheet1”

mainworkBook.Sheets(“Sheet1”).UsedRange.Copy

Read moreVBA-Excel: Copy/Paste data – Copy the Entire data from one sheet to another

VBA-Excel: Copy/Paste data – Copy the Entire row data and paste it to another row

In VBA-Excel, Copy and paste the data plays an important role, we can copy data from one place and paste it at some other place in the same way like how we do it manually, and when you copy some data its goes to the Clipboard from there you can paste it at some other location.

Dim mainworkBook As Workbook

Set mainworkBook = ActiveWorkbook

Copy the Entire row data and paste it to another row.

For example  if you want to copy the data from row 5 of “Sheet1” and paste it to in “Sheet2”.

For copy the data present in row 5 from “Sheet1”

mainworkBook.Sheets(“Sheet1”).Rows(5).EntireRow.Copy

Read moreVBA-Excel: Copy/Paste data – Copy the Entire row data and paste it to another row

VBA-Excel: Copy/Paste data – Copy the range of data and paste it to another range

In VBA-Excel, Copy and paste the data plays an important role, we can copy data from one place and paste it at some other place in the same way like how we do it manually, when you copy some data its goes to the Clipboard from there you can paste it at some other location.

Dim mainworkBook As Workbook

Set mainworkBook = ActiveWorkbook

Copy  the range of data and paste it to another range.

For example  if you want to copy the data from Range “A1” to “C10” of “Sheet1” and paste it to in “Sheet2”.

For copy the data present in Range “A1” to “C10” from “Sheet1”

mainworkBook.Sheets(“Sheet1”).Range(“A1:C10”).Copy

Read moreVBA-Excel: Copy/Paste data – Copy the range of data and paste it to another range

VBA-Excel: Copy/Paste data – Copy the data from a call and paste it to another cell

In VBA-Excel, Copy and paste the data plays an important role, we can copy data from one place and paste it at some other place in the same way like how we do it manually, when you copy some data its goes to the Clipboard from there you can paste it at some other location.

Dim mainworkBook As Workbook

Set mainworkBook = ActiveWorkbook

Copy a data from a call and paste it to another cell

For example if you want to copy the data from cell “C6” of “Sheet1” and paste it to “B2” in “Sheet2”.

First copy the data present in cell “C6” from “Sheet1”

mainworkBook.Sheets(“Sheet1”).Range(“C6”).Copy

Read moreVBA-Excel: Copy/Paste data – Copy the data from a call and paste it to another cell