Search : in
By :

Excel active cell macro

Last answer on Sep 23, 2008 7:54:05 pm BST Nowise, on Sep 23, 2008 1:16:54 pm BST 
 Report this message to moderators

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

Best answers for « Excel active cell macro » in :
[Excel]changing cell formula to text Show[Excel]changing cell formula to text Issue Solution Notes Issue Consider that I have: In cell A4, it contains a formula =Sum(A1:B3)+A3/B2. How to extract this formula in cell A6 as a string of text? That is ... I want cell A6...
Excel – Comparing cell A1 to entire A column in Sheet 2 ShowExcel – Comparing cell A1 to entire A column in Sheet 2 Issue Solution Note Issue I have been trying to compare sheet1 A2 to sheet2 A2 through A500 and if it exists somewhere in sheet2's a col then copy that entire row to a new sheet....
Excel tips : How to insert date in a cell ShowExcel tips : How to insert date in a cell Below are some tips on how to insert date and time in an excel cell for a specific purpose:- To insert current date, press CTRL ¯+ ;¯ in the chosen cell. To insert current time, press CTRL¯+...
Worksheet - Cells ShowThe Concept of a Cell A "cell" is the intersection between a line (horizontal) and a column (vertical) on a worksheet. Thus, the name of the line combined with the name of the column gives the cell's coordinates (the term address is sometimes also...

1

natgt123, on Sep 23, 2008 6:39:10 pm BST

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

Reply to natgt123

2

 Nowise, on Sep 23, 2008 7:54:05 pm BST
  • +8

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

Reply to Nowise