View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Barnie Barnie is offline
external usenet poster
 
Posts: 4
Default VB Code For Macro

I have done that and have got my code. The problem I am now experiencing is
that when I press the button it does not allow me to paste to the specific
cell I need. For example I need to be able to copy from any of columns D to I
and paste only to column L and only for the same row I am copying on.

Here is the code I have:
Range("D1").Select
Selection.Copy
Range("L1").Select
ActiveSheet.Paste

Would it be a case of just changing the range to ("D1,E1,F1,H1,I1,J1")?

Thanks
--
Barnie Gumble Esq


"Philip" wrote:

Hi,

The best way for you to learn something like this (the same as for everyone
- myself included) is to use the Macro recorder on the Tools...Macros menu

This is always the best way to start when you don't know what objects you
need...

When you have finished recording the actions that you need the code for,
click Stop on the Tools..Macros menu, and use ALT-F8 to show the Macros
dialog.

Select the new macro that you just recorded, and choose 'Edit'

then you can see the code that has been recorded, and this will help you see
what objects are used, and give you a head start.

If you are still stuck modifying the code, let uis know and we'll help ...

HTH

Philip

"Barnie" wrote:

I need to build a macro that will copy from whatever cell I have highlited
and paste to a specific other cell. The idea is that I have entered a control
button and when pressed the macro is run. Unfortunately I know nothing about
building it on VB. Could someone give me the code to copy and paste into
visual basic. I need to do this on multiple buttons so I realise I will have
to change the destination part of the code. Could you show me where I change
this.

Thanks in advance
--
Barnie Gumble Esq