VB for Excel Question - Easy One !!

VB for Excel Question - Easy One !!

Didn't find your answer?

I have an annoying small problem in that some simple code (within a larger macro) will not execute.

I have tried to record this, but despite recording, it wont work when used.

All I need to do is'..

From having three cells selected as one range (say A1 to C1),
Offset down one cell,
paste special as value (from clipboard),

This would then mean that excell offsets to cell A2, and paste special to cells A2 to C2.

Of course, just a component of a larger macro

Any ideas, please

Raymond Downham

Replies (3)

Please login or register to join the discussion.

avatar
By Richard Willis
22nd May 2006 14:39

Good grief, a VBA question to which I can contribute!
Hi Raymond

I am a complete novice at VBA, (see my 'announcement' below!) but I have already worked out that if you use named ranges in macros, especially for copy/paste excercises, it saves a lot of problems with making sure that the macro is in the correct place when it executes. If you name the source and the target, it will work even of the last reference was on a different worksheet.

Thanks (0)
avatar
By ACDWebb
22nd May 2006 11:18

Try
With Selection
.Copy
.Offset(1, 0).PasteSpecial Paste:=xlPasteValues
End With
Application.CutCopyMode = False

Thanks (0)
avatar
By velohead
23rd May 2006 02:23

Success !
Problem solved.

The ‘recorded’ version did not work (as I now realise) as I had failed to tick a ‘radio button’ that was pre-selected by excel.

I guess rule number one when recording is to tick all necessary boxes, even those with default selections.
D’oh ! - wont repeat that error again.

Thanks All.

Thanks (0)