Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Hugh Jago
 
Posts: n/a
Default Help Pls re macro cell address

I'm still having a problem with getting my macro to use a variable cell
address.
I'm trying to get the cursor to the cell two rows below my inported data,
and then cut and paste additional calculations. The data will vary in
length each time.

As an example if I start with Data from A2 to A6 then I need to go to A2,
count down, and in cell A8 I want to bring in additional calculations.
The next time I may have data from A2 to A2000, so the additional
calculations
will be pasted into A2002.
If I use the 'shift + ctrl' down arrow, when I enter data it sets the macro
with absolute adress. so the next time I use the macro the calculations are
in the wrong place.
Any ideas please with greatly appreciated.




  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

After importing your data, set a range object variable to the cell two
below the last filled cell:

Dim rDest As Range
Set rDest = Cells(Rows.Count, 1).End(xlUp).Offset(2, 0)

Then copy data to that range:

Sheets("Sheet1").Range("A1:J1").Copy Destination:=rDest

In article ,
"Hugh Jago" wrote:

I'm still having a problem with getting my macro to use a variable cell
address.
I'm trying to get the cursor to the cell two rows below my inported data,
and then cut and paste additional calculations. The data will vary in
length each time.

As an example if I start with Data from A2 to A6 then I need to go to A2,
count down, and in cell A8 I want to bring in additional calculations.
The next time I may have data from A2 to A2000, so the additional
calculations
will be pasted into A2002.
If I use the 'shift + ctrl' down arrow, when I enter data it sets the macro
with absolute adress. so the next time I use the macro the calculations are
in the wrong place.
Any ideas please with greatly appreciated.

  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Hugh

Selection.Copy Destination:= Sheets("Sheet2").Cells(Rows.Count, 1) _
.End(xlUp).Offset(2, 0)


Gord Dibben Excel MVP

On Wed, 5 Jan 2005 19:51:54 +0000 (UTC), "Hugh Jago" wrote:

I'm still having a problem with getting my macro to use a variable cell
address.
I'm trying to get the cursor to the cell two rows below my inported data,
and then cut and paste additional calculations. The data will vary in
length each time.

As an example if I start with Data from A2 to A6 then I need to go to A2,
count down, and in cell A8 I want to bring in additional calculations.
The next time I may have data from A2 to A2000, so the additional
calculations
will be pasted into A2002.
If I use the 'shift + ctrl' down arrow, when I enter data it sets the macro
with absolute adress. so the next time I use the macro the calculations are
in the wrong place.
Any ideas please with greatly appreciated.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting a variable cell address Hugh Jago Excel Discussion (Misc queries) 3 January 5th 05 03:45 PM
Concatenate cells without specifying/writing cell address individually Hari Excel Discussion (Misc queries) 4 January 3rd 05 06:05 PM
How do I dynamically retrieve the cell address of the last cell t. Nancy Excel Discussion (Misc queries) 1 December 20th 04 02:52 PM
Relative Macro Help on Keystrokes Neal Zimm Excel Discussion (Misc queries) 9 December 15th 04 12:31 AM
Moving Down a Cell in Macro Anonymous Excel Discussion (Misc queries) 2 December 5th 04 09:50 AM


All times are GMT +1. The time now is 01:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"