Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
lwm lwm is offline
external usenet poster
 
Posts: 38
Default capturing current range of cells


I am developing several utilities that I can give to my customers. I am a
financial and accounting consultant to businesses specializing in Excel.

The user selects a cell.

I want to place that cell in a variable so I can use it in the future.

i.e. x= cell selected.

Location of new stuff cells(1,x+6)

Or
range = range(x, x=6)
range(x).select
Or

The user selects a range a12.r12

I want to save that range in a variable so I can use it in a future function.

X= A12.R12 wont work because it is absolute. I need a relative address..

I am looking for something like

X= range.select

Selection.AutoFill Destination:=ActiveCell.Range(x), Type:=xlFillDefault

This selects the appropriate range and then copies the appropriate data.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default capturing current range of cells

dim X as range
Set x = selection

or

Dim X as range
Set X = Range(activecell, activecell.offset(6,1))

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"lwm" wrote in message
...

I am developing several utilities that I can give to my customers. I am a
financial and accounting consultant to businesses specializing in Excel.

The user selects a cell.

I want to place that cell in a variable so I can use it in the future.

i.e. x= cell selected.

Location of new stuff cells(1,x+6)

Or
range = range(x, x=6)
range(x).select
Or

The user selects a range a12.r12

I want to save that range in a variable so I can use it in a future
function.

'X= "A12.R12" won't work because it is absolute. I need a relative
address..

I am looking for something like

X= range.select

Selection.AutoFill Destination:=ActiveCell.Range(x), Type:=xlFillDefault

This selects the appropriate range and then copies the appropriate data.



  #3   Report Post  
Posted to microsoft.public.excel.programming
lwm lwm is offline
external usenet poster
 
Posts: 38
Default capturing current range of cells

Unfortunately this

Selection.AutoFill Destination:=ActiveCell.Range(x), Type:=xlFillDefault

gives the error select only one cell.

If I use x="a1:L1" it works


dim X as range
Set x = selection

gives erro that is my problem.

"Bob Flanagan" wrote:

dim X as range
Set x = selection

or

Dim X as range
Set X = Range(activecell, activecell.offset(6,1))

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"lwm" wrote in message
...

I am developing several utilities that I can give to my customers. I am a
financial and accounting consultant to businesses specializing in Excel.

The user selects a cell.

I want to place that cell in a variable so I can use it in the future.

i.e. x= cell selected.

Location of new stuff cells(1,x+6)

Or
range = range(x, x=6)
range(x).select
Or

The user selects a range a12.r12

I want to save that range in a variable so I can use it in a future
function.

'X= "A12.R12" won't work because it is absolute. I need a relative
address..

I am looking for something like

X= range.select

Selection.AutoFill Destination:=ActiveCell.Range(x), Type:=xlFillDefault

This selects the appropriate range and then copies the appropriate data.




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
Autofilter not capturing all cells panther42 Excel Worksheet Functions 1 October 21st 08 04:36 PM
Capturing current folder path DKS Excel Programming 2 August 14th 06 11:34 AM
Macro select all cells in current range Mary Ann Excel Discussion (Misc queries) 3 December 12th 05 07:19 AM
Help : Macro for capturing current system time imr Excel Programming 3 July 2nd 04 02:58 AM
On Error, Capturing current module and actual line of code Paul Martin Excel Programming 4 June 13th 04 06:21 AM


All times are GMT +1. The time now is 12:56 PM.

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"