Excel active cell macro

Closed
Nowise - Sep 23, 2008 at 08:16 AM
 Nowise - Sep 23, 2008 at 02:54 PM
Hello,

I'm trying to write a macro in excel which would copy and paste a range from WITHIN THE SAME ROW in the same sheet as the active cell is selected. For example let's say i select a cell within range A6:P36 then i would like the macro to copy and paste a spesific range from the same row the active cell is selected to a specific location. The Program would alter what it copies depending on which row the active cell is..

Can someone please help me I've tried but I don't seem to get it to work properly.

Thanx in advance
- Nowise excel programmer
Related:

2 responses

Hi,

I've tried something in this style,

Sub ()
Worksheets("Sheet1").Activate
Range("A1:D10").Select
If active.cell.selected Then
Selection.Copy
Sheets("Sheet1").Select
Range("A1:M1").Select
ActiveSheet.Paste
Else
End If
End Sub

I manage to get active cell to do simple tasks, but I can't find or manage to get it to
copy from the same row. E.g. If I clik on cell B5 the program is supposed to copy data
from F5:H5 and paste it into A1:C1 on the same sheet and so on...I've tried using the row command
without success.

I couldn't find what I was looking for on the forum..sorry - I'm open to suggestions

Regards,
Nowiser
16
natgt123 Posts 10 Registration date Saturday August 30, 2008 Status Member Last seen March 31, 2009 1
Sep 23, 2008 at 01:39 PM
hi,

have you tried reading the help files about macros on the forum itself you might get what you are in search of in it
-9