Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VARIABLE IN EXCEL MACRO

Partially, I also expected the answer to give a solution for selecting a
specific part of a block like from a certain cell to 2O lines below and/or 5
colums to the right.

"Stopher" wrote:


Ulrik loves horses wrote:

Try to copy various data from various places to another sheet using Excel
Macro, as this is required on a weekly basis.
However the data which needs copied is always in blocks, but the number of
Lines as well as the number of columns is changing.
Will need to take variable selection criteria in Excel macro as this is
possible in Excel.

Go to a certain cell
select an array using <End Left <End Down functions.
How would you translate these instructions in a Macro?


What about:

' Go to a certain cell
Range ("A1"). select

' Select the current block of data

Selection.CurrentRegion.Select

Does this help any??


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VARIABLE IN EXCEL MACRO

set rng = Range("B9").Resize(20,5)
msgbox rng.Address
rng.Select

--
Regards,
Tom Ogilvy

"Ulrik loves horses" wrote in
message ...
Partially, I also expected the answer to give a solution for selecting a
specific part of a block like from a certain cell to 2O lines below and/or
5
colums to the right.

"Stopher" wrote:


Ulrik loves horses wrote:

Try to copy various data from various places to another sheet using
Excel
Macro, as this is required on a weekly basis.
However the data which needs copied is always in blocks, but the number
of
Lines as well as the number of columns is changing.
Will need to take variable selection criteria in Excel macro as this is
possible in Excel.

Go to a certain cell
select an array using <End Left <End Down functions.
How would you translate these instructions in a Macro?


What about:

' Go to a certain cell
Range ("A1"). select

' Select the current block of data

Selection.CurrentRegion.Select

Does this help any??




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VARIABLE IN EXCEL MACRO

Thanks for the info but the 20 and the 5 were just an example . These
variables and will change from day to day, so I really would like to work
also with the end left and sometimes with the end right instructions.


"Tom Ogilvy" wrote:

set rng = Range("B9").Resize(20,5)
msgbox rng.Address
rng.Select

--
Regards,
Tom Ogilvy

"Ulrik loves horses" wrote in
message ...
Partially, I also expected the answer to give a solution for selecting a
specific part of a block like from a certain cell to 2O lines below and/or
5
colums to the right.

"Stopher" wrote:


Ulrik loves horses wrote:

Try to copy various data from various places to another sheet using
Excel
Macro, as this is required on a weekly basis.
However the data which needs copied is always in blocks, but the number
of
Lines as well as the number of columns is changing.
Will need to take variable selection criteria in Excel macro as this is
possible in Excel.

Go to a certain cell
select an array using <End Left <End Down functions.
How would you translate these instructions in a Macro?

What about:

' Go to a certain cell
Range ("A1"). select

' Select the current block of data

Selection.CurrentRegion.Select

Does this help any??





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VARIABLE IN EXCEL MACRO

If you in the upper right corner of your data then:

range(activecell.End(xltoLeft).End(xldown),activec ell).Select


--
Regards,
Tom Ogilvy



"Ulrik loves horses" wrote in
message ...
Thanks for the info but the 20 and the 5 were just an example . These
variables and will change from day to day, so I really would like to work
also with the end left and sometimes with the end right instructions.


"Tom Ogilvy" wrote:

set rng = Range("B9").Resize(20,5)
msgbox rng.Address
rng.Select

--
Regards,
Tom Ogilvy

"Ulrik loves horses" wrote
in
message ...
Partially, I also expected the answer to give a solution for selecting
a
specific part of a block like from a certain cell to 2O lines below
and/or
5
colums to the right.

"Stopher" wrote:


Ulrik loves horses wrote:

Try to copy various data from various places to another sheet using
Excel
Macro, as this is required on a weekly basis.
However the data which needs copied is always in blocks, but the
number
of
Lines as well as the number of columns is changing.
Will need to take variable selection criteria in Excel macro as this
is
possible in Excel.

Go to a certain cell
select an array using <End Left <End Down functions.
How would you translate these instructions in a Macro?

What about:

' Go to a certain cell
Range ("A1"). select

' Select the current block of data

Selection.CurrentRegion.Select

Does this help any??







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
Running a variable macro when any value is entered into a variable cell [email protected] Excel Programming 3 December 14th 05 05:15 PM
How to set variable to cell value in excel macro most xlent Excel Discussion (Misc queries) 6 October 27th 05 06:52 PM
How do I set a macro to print variable number of pages in excel? Livio Excel Discussion (Misc queries) 1 July 30th 05 12:15 AM
Macro Creating Variable and using variable in a SQL statement Jimmy Excel Programming 4 October 25th 04 02:36 AM
entering formula using variable in Excel Macro doc-s Excel Programming 1 August 18th 04 08:27 PM


All times are GMT +1. The time now is 08:41 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"