LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default exact copy/paste

Hi JM,

See Chip Pearson's ClipBoard page at:

http://www.cpearson.com/excel/clipboar.htm

See particularly, the CopyFormula and PasteFormula macros at the foot of the
page and note Chip's right-click menu suggestion.

Note that to use these macros, you need to set a reference in the VBE to the
Microsoft Forms 2.0 object library..


---
Regards,
Norman



"jmwismer" wrote in
message ...

Hi there,

I often need to perform an "exact copy-paste", i.e.

=$a$1+b1

gets copied two lines below as

=$a$1 + b1

and not as

=$a$1 + b3

I obviously would like this done without having to change "b1" to
"$b$1". Since I could not find any tips or functions to get this done,
I suppose that I will have to write a VB macro to do that. Here is how
I see it:

1. I select a range of cells, and do a CTRL-C to get those in the clip
board
2. I select a traget cell
3. I do a, say, CTRL-SHF-V to perform my exact copy to the new
location.

My VB experience is close to zero, and OO competence is absolutely
zero.

I could manage (see code below) to get this done via input boxes, but
I would like to replace the input selection by taking copied cells
directly from the clipboard, and to replace the output selection by
getting location of active cell and pasting from there.

Can anyone help?

thx a lot,
jm


Dim mycells1, mycells2 As Range
Dim cells As Range
Dim i, cellules, cell(100)
Set mycells1 = Application.InputBox(prompt:="Input range.", _
Title:="Exact Copy-Paste", Left:=500, Top:=300, Type:=8)
i = 1
For Each cellules In mycells1
cell(i) = cellules.Value
i = i + 1
Next

i = 1
Set mycells2 = Application.InputBox(prompt:="Output range.", _
Title:="Exact Copy-Paste", Left:=500, Top:=300, Type:=8)

For Each cellules In mycells2
cellules.Value = cell(i)
i = i + 1
Next


--
jmwismer
------------------------------------------------------------------------
jmwismer's Profile:
http://www.excelforum.com/member.php...o&userid=28201
View this thread: http://www.excelforum.com/showthread...hreadid=477424



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
exact copy Jean-Paul Excel Worksheet Functions 5 October 16th 08 11:45 AM
How to paste exact value into another cell? Lewis0205NC Excel Worksheet Functions 4 January 17th 07 11:26 PM
Exact Copy Saxman Excel Discussion (Misc queries) 3 May 25th 06 07:21 PM
Exact formula copy. Richard Excel Discussion (Misc queries) 2 December 20th 05 05:21 PM
How to do the exact copy of a formula Michal Excel Worksheet Functions 8 October 20th 05 04:27 PM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"