ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Problems with Ranges (https://www.excelbanter.com/excel-discussion-misc-queries/149838-problems-ranges.html)

M&M

Problems with Ranges
 
Hello, do any of you know why this is not working?

Range("A1").End(xlDown + 1) = "FINAL"

I have data in sheet 3. and I want to put in " FINAL" at the end of column
A, where there is no data.
Do I need to specify the sheet?
How?

Mike H

Problems with Ranges
 
You may need to specify the sheet it depends which is the active sheet but in
the first instance you need to get the syntax correct, try:-


ActiveSheet.Range("A65536").End(xlUp).Offset(1, 0).Value = "FINAL"

Mike

"M&M" wrote:

Hello, do any of you know why this is not working?

Range("A1").End(xlDown + 1) = "FINAL"

I have data in sheet 3. and I want to put in " FINAL" at the end of column
A, where there is no data.
Do I need to specify the sheet?
How?


Gord Dibben

Problems with Ranges
 
Range("A1").End(xlDown).Offset(1, 0).Value = "FINAL"

Note: this works only if there are no blanks in column A

Best to work up from the bottom of the column.

Sub findbottom()
ActiveSheet.Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0).value = "FINAL"
End Sub


Gord Dibben MS Excel MVP

On Wed, 11 Jul 2007 12:10:04 -0700, M&M wrote:

Hello, do any of you know why this is not working?

Range("A1").End(xlDown + 1) = "FINAL"

I have data in sheet 3. and I want to put in " FINAL" at the end of column
A, where there is no data.
Do I need to specify the sheet?
How?




All times are GMT +1. The time now is 06:00 AM.

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