ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last row plus one (https://www.excelbanter.com/excel-programming/338769-last-row-plus-one.html)

Alex Martins[_2_]

Last row plus one
 
range("a1").end(xldown).offset(1,0)

This works, but it asks me to put and "="...how can I make this work to
paste a previous selection?

Many thanks in advance
Alex


Chip Pearson

Last row plus one
 
You need to set a variable to the result of your line of code, or
assign a value to it. E.g.,


Dim Rng As Range
Set Rng = range("a1").end(xldown).offset(1,0)
' or
range("a1").end(xldown).offset(1,0) = 123


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Alex Martins" wrote in
message
...
range("a1").end(xldown).offset(1,0)

This works, but it asks me to put and "="...how can I make this
work to
paste a previous selection?

Many thanks in advance
Alex




Alex Martins[_2_]

Last row plus one
 
Hey Chip. Thanks for the answer man.

This is what I've been doing and I can't get it to work. Do you have any
ideas?
Dim Rng As Range
Set Rng = Sheets("BD1").Range("C5").End(xlDown).Offset(1, 0)
Sheets("NEW FILINGS").Range("K12:O12").Select
Selection.Copy
Range("Rng").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

Thanks for the help, and your site was really helpful man!
Alex


"Chip Pearson" wrote:

You need to set a variable to the result of your line of code, or
assign a value to it. E.g.,


Dim Rng As Range
Set Rng = range("a1").end(xldown).offset(1,0)
' or
range("a1").end(xldown).offset(1,0) = 123


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"Alex Martins" wrote in
message
...
range("a1").end(xldown).offset(1,0)

This works, but it asks me to put and "="...how can I make this
work to
paste a previous selection?

Many thanks in advance
Alex






All times are GMT +1. The time now is 06:46 PM.

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