Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default selecting a variable row range

I have the following code working to select my fixed
source and destination ranges. How do I change my fixed
sourceRange to a variable sourceRange. Currently the
sourceRange is fixed .Range(K3:M3), this is date data, but
I could have 1 date in K3 only or dates from K3 to IV3.
How do I select this variable range?

Dim sourceRange As Range, destRange As Range
Dim Lr As Long

Lr= LastRow(Sheets("S1"))+1
Set sourceRange = Sheets("S1").Range("K3:M3")

I already setup my LastRow and LastColumn FUNCTIONs to
support Lr. Thanks goes to Ron de Bruin and his website
for coding help. Thanks for the help.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default selecting a variable row range

See my reply to your other post

"Dan" wrote:

I have the following code working to select my fixed
source and destination ranges. How do I change my fixed
sourceRange to a variable sourceRange. Currently the
sourceRange is fixed .Range(K3:M3), this is date data, but
I could have 1 date in K3 only or dates from K3 to IV3.
How do I select this variable range?

Dim sourceRange As Range, destRange As Range
Dim Lr As Long

Lr= LastRow(Sheets("S1"))+1
Set sourceRange = Sheets("S1").Range("K3:M3")

I already setup my LastRow and LastColumn FUNCTIONs to
support Lr. Thanks goes to Ron de Bruin and his website
for coding help. Thanks for the help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default selecting a variable row range


Set sourceRange = Sheets("S1").Range(Range("K3"),Cells(LastRow,LastC ol))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dan" wrote in message
...
I have the following code working to select my fixed
source and destination ranges. How do I change my fixed
sourceRange to a variable sourceRange. Currently the
sourceRange is fixed .Range(K3:M3), this is date data, but
I could have 1 date in K3 only or dates from K3 to IV3.
How do I select this variable range?

Dim sourceRange As Range, destRange As Range
Dim Lr As Long

Lr= LastRow(Sheets("S1"))+1
Set sourceRange = Sheets("S1").Range("K3:M3")

I already setup my LastRow and LastColumn FUNCTIONs to
support Lr. Thanks goes to Ron de Bruin and his website
for coding help. Thanks for the help.




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
Selecting a variable range Dan Excel Programming 2 November 2nd 04 06:02 AM
Selecting a variable range Colin Foster[_3_] Excel Programming 3 October 26th 04 11:02 PM
Selecting a variable Range Brett[_6_] Excel Programming 1 September 9th 04 02:46 AM
Selecting Variable Row Range w/Macro steve Excel Programming 3 February 26th 04 07:24 PM
Selecting a Range Using a Variable Bob J. Excel Programming 4 September 14th 03 09:24 PM


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