ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding Range of one Workheet used in another (https://www.excelbanter.com/excel-programming/357414-finding-range-one-workheet-used-another.html)

parteegolfer

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


Norman Jones

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




duane[_64_]

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


parteegolfer

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


parteegolfer

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


Norman Jones

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




Tom Ogilvy

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




All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com