Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding Range of one Workheet used in another


I need to find the last row of worksheet A and use this as range fo
worksheet B. Workshhet A can change row count so I need B to canhang
as well

Example:


VBA:
Range("A10").Select
Selection.Copy
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF('Recap Report'!R[-3]C2="""","""",'Recap Report'!R[-3]C2)"
Selection.Copy
Range("A10:A56").Select << I Need this value To be As many rows As I
worksheet(Recap Report)
ActiveSheet.Paste

Any Suggestions

--
parteegolfe
-----------------------------------------------------------------------
parteegolfer's Profile: http://www.excelforum.com/member.php...fo&userid=3195
View this thread: http://www.excelforum.com/showthread.php?threadid=52741

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Finding Range of one Workheet used in another

Hi Partegolfer,

I need to find the last row of worksheet A and use this as range for
worksheet B. Workshhet A can change row count so I need B to canhange
as well


Dim LRow As Long
Dim rng As Range


LRow = Sheets("A").Cells(Rows.Count, "A").End(xlUp).Row
Set rng = Sheets("B").Range("A10:A" & LRow)


---
Regards,
Norman



"parteegolfer"
wrote in message
...

I need to find the last row of worksheet A and use this as range for
worksheet B. Workshhet A can change row count so I need B to canhange
as well

Example:


VBA:
Range("A10").Select
Selection.Copy
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"=IF('Recap Report'!R[-3]C2="""","""",'Recap Report'!R[-3]C2)"
Selection.Copy
Range("A10:A56").Select << I Need this value To be As many rows As In
worksheet(Recap Report)
ActiveSheet.Paste

Any Suggestions?


--
parteegolfer
------------------------------------------------------------------------
parteegolfer's Profile:
http://www.excelforum.com/member.php...o&userid=31951
View this thread: http://www.excelforum.com/showthread...hreadid=527414



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding Range of one Workheet used in another


something like

myrow = Sheets("Recap Report").Range("A65536").end(xlup).row

assuming column A will contain the highest row

then in your code

Selection.Copy
Range(cells(10,1),cells(myrow,1).select
ActiveSheet.Past

--
duan

-----------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...fo&userid=1162
View this thread: http://www.excelforum.com/showthread.php?threadid=52741

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding Range of one Workheet used in another


Duane,

I get a complie error in line -
Range(cells(10,1),cells(myrow,1).select

any ideas why?


--
parteegolfer
------------------------------------------------------------------------
parteegolfer's Profile: http://www.excelforum.com/member.php...o&userid=31951
View this thread: http://www.excelforum.com/showthread...hreadid=527414

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding Range of one Workheet used in another


Sorry its a Syntax error

Range(cells(10,1),cells(myrow,1).select


--
parteegolfer
------------------------------------------------------------------------
parteegolfer's Profile: http://www.excelforum.com/member.php...o&userid=31951
View this thread: http://www.excelforum.com/showthread...hreadid=527414



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Finding Range of one Workheet used in another

Hi Parteegolfer,

I suspect that your reply was intended for Duane rather than me.

Try, however, adding a closing parenthesis:

Range(Cells(10, 1), Cells(myrow, 1)).Select

---
Regards,
Norman



"parteegolfer"
wrote in message
news:parteegolfer.25eynm_1143606301.3951@excelforu m-nospam.com...

Sorry its a Syntax error

Range(cells(10,1),cells(myrow,1).select


--
parteegolfer
------------------------------------------------------------------------
parteegolfer's Profile:
http://www.excelforum.com/member.php...o&userid=31951
View this thread: http://www.excelforum.com/showthread...hreadid=527414



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Finding Range of one Workheet used in another

If column A is being filled with formulas, unless the formulas are
overwriting existing values, it seems unlikely the extent of the report could
be determined from column A.

Just a thought.

--
Regards,
Tom Ogilvy


"duane" wrote:


something like

myrow = Sheets("Recap Report").Range("A65536").end(xlup).row

assuming column A will contain the highest row

then in your code

Selection.Copy
Range(cells(10,1),cells(myrow,1).select
ActiveSheet.Paste


--
duane


------------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...o&userid=11624
View this thread: http://www.excelforum.com/showthread...hreadid=527414


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
Workheet. Pat-rice1 Excel Worksheet Functions 1 August 15th 07 08:31 AM
Can I use variables for workheet name references in Excel functions? Amihai Bareket Excel Discussion (Misc queries) 1 February 4th 05 05:11 PM
Can I use variables for workheet name references in Excel functions? Amihai Bareket Excel Worksheet Functions 1 February 4th 05 05:11 PM
Adding checkboxes via code to a workheet Stef Excel Programming 0 February 1st 05 02:51 PM
Finding from a range Mark[_50_] Excel Programming 1 August 26th 04 12:19 PM


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