Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Conditional actions

Hi,
What I am attempting to do is make a cut and paste in a macro with a
variable length that is determined by a number or adress listed in a cell. Is
this possible using the INDIRECT reference?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Conditional actions

In a macro, there is no need for the INDIRECT function.

Let's say that the row number you want to copy through is in cell A1. Then
use:
Range("B2:B" & Range("A1").Value).Copy

If it is a cell address in cell A1, then use:
Range("B2:" & Range("A1").Value).Copy

If it is a range address in cell A1, then use:
Range(Range("A1").Value).Copy

And quite likely, you can calculate the value without using the extra cell.
But your description lacks clues as to what you are doing.

HTH,
Bernie
MS Excel MVP


"Chris Manning" wrote in message
...
Hi,
What I am attempting to do is make a cut and paste in a macro with a
variable length that is determined by a number or adress listed in a cell.

Is
this possible using the INDIRECT reference?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Conditional actions

Bernie-
thanks for the tip. More specifically, what I am trying to do is have a user
input a data set of variable length, and then have a VBA GUI pop up and the
user will input how long the data table is, and then excel will enter that
data into a cell, and an equation in another cell will then convert that to
the addresses of the start and end of the data set, and then the macro will
copy and paste that data set to other worksheets. Is the correct and easiest
method for this the Range function that you listed?

"Bernie Deitrick" wrote:

In a macro, there is no need for the INDIRECT function.

Let's say that the row number you want to copy through is in cell A1. Then
use:
Range("B2:B" & Range("A1").Value).Copy

If it is a cell address in cell A1, then use:
Range("B2:" & Range("A1").Value).Copy

If it is a range address in cell A1, then use:
Range(Range("A1").Value).Copy

And quite likely, you can calculate the value without using the extra cell.
But your description lacks clues as to what you are doing.

HTH,
Bernie
MS Excel MVP


"Chris Manning" wrote in message
...
Hi,
What I am attempting to do is make a cut and paste in a macro with a
variable length that is determined by a number or adress listed in a cell.

Is
this possible using the INDIRECT reference?




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
unreadable content with no further actions Bing Excel Discussion (Misc queries) 0 November 7th 09 03:11 PM
Hep with Conditionals actions please. Mark Excel Worksheet Functions 2 February 8th 09 04:02 PM
Different actions on a pivotal value smaruzzi Excel Worksheet Functions 0 November 17th 06 10:29 PM
How to perform two actions ? morph000 Excel Worksheet Functions 5 January 22nd 06 02:13 AM
Actions on certain Worksheets Grant Reid Excel Programming 5 May 10th 04 02:45 PM


All times are GMT +1. The time now is 07:55 AM.

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

About Us

"It's about Microsoft Excel"