Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
exact copy | Excel Worksheet Functions | |||
How to paste exact value into another cell? | Excel Worksheet Functions | |||
Exact Copy | Excel Discussion (Misc queries) | |||
Exact formula copy. | Excel Discussion (Misc queries) | |||
How to do the exact copy of a formula | Excel Worksheet Functions |