Question about pasting specific cell information from clipboard using VBA

YetAnotherDave

New Member
Joined
Sep 29, 2022
Messages
2
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Everyone is familiar with the "Paste Column Widths" command that will take information from the clipboard and use it to transfer the column widths of a copied range to another range without including the actual data from the cells that were copied. Thus, it seems to me that when a range of cells are copied using the clipboard, information about the cells is stored.

But what about row heights? It is fairly easy to write a sub or function that will take a range of cells and another cell as input to transfer the row heights of the first range to a location starting at the second input cell. I wrote a simple sub that does exactly this, but I was thinking that it would be an improvement if I could get it to work more like the built-in Excel routine for pasting column widths. In other words, I want to use the same clipboard data that is already stored when I cut or copy a range of cells to paste the row heights.

Since the clipboard stores column width data along with cell values, does it also store the row heights or some means of reproducing them from the original range?

Does anyone know if it is possible to use VBA to transfer row height information using the clipboard in the same manner as Excel does with the column widths? Or should I just live with copying the source range twice - once for the clipboard operations and then again as part of a VBA sub to set the row heights?

If it is possible, I don't need anyone to write the code for me, I just need to know how to access cell information from the clipboard and I can take it from there. My thanks to anyone who knows the answer and can help.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,181,677
Messages
5,931,368
Members
436,788
Latest member
er19

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
Top