Pasting problem

L

Libby

hi

I have a workbook with a button
When the user clicks the button another workbook is opened
and a value in the first workbook is searched for.
Presuming its found, the found range + offset(0,4) is
activated and the user will then be presented with a
message box which they will answer probably answer yes to.

What I want to do now is copy the values from range
(c12:g12) in the first workbook and paste them in the
second workbook without any formats to
range(activecell.offset(0,4) : activecell.offset(0,8))

Does anyone know how to do this, preferably without the
cutcopymode being used.

Many thanks in advance
 
B

BrianB

Here is partial code that should help :-

Code:
--------------------

Dim ToRow As Long
Dim ToCol As Integer
Dim FoundCell As Object
Dim FromRange As Range
Dim ToRange As Range
'-------------------------------
Set FromRange = ActiveSheet.Range("C12:G12")
'- do find
'set Foundcell = ... etc. (no need to Activate or Select)
'
' transfer found values
ToRow = FoundCell.Row
ToCol = FoundCell.Column
Set ToRange = Worksheets("sheet2") _
.Range(Cells(ToRow, ToCol + 4), Cells(ToRow, ToCol + 8))
ToRange.Value = FromRange.Value
 
Top