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 :
[VBA] Detecting changes in cell Show[VBA] Detecting changes in cell The Event Change feature of a sheet will detects the change in the active cell but it gives no information about the content. The example given below will help you to find out if the cell was changed,...
[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 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¯+...
Spreadsheets - Cell Selection ShowCell Selection Spreadsheets are powerful tools for working with data. However, to work with data, it is necessary to have tools to rapidly choose the required cells. Line Selection An entire line can be chosen by clicking directly on the line...

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
  • +7

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