ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple Macro... i guess (https://www.excelbanter.com/excel-programming/400803-simple-macro-i-guess.html)

Vincent

Simple Macro... i guess
 
Hi everyone,

I´m a noob at VBA, so sorry if i offend anyone:)

I want a macro that goes to the last written cell of a column.
I tried:

Sub Macro 1

Max(Range("C:C")).Select

End Sub

Wich obviously didn´t work. In column C i had to insert the function
IF(B="";"";row()) in order to have the maximum value matching the last
written cell in column B.
I wanted that macro to send me to the maximum value of column C :)

Best Regards

papou[_4_]

Simple Macro... i guess
 
Hello Vincent

Range("C65536").End(xlUp)

HTH
Cordially
Pascal


"Vincent" a écrit dans le message de
news: ...
Hi everyone,

I´m a noob at VBA, so sorry if i offend anyone:)

I want a macro that goes to the last written cell of a column.
I tried:

Sub Macro 1

Max(Range("C:C")).Select

End Sub

Wich obviously didn´t work. In column C i had to insert the function
IF(B="";"";row()) in order to have the maximum value matching the last
written cell in column B.
I wanted that macro to send me to the maximum value of column C :)

Best Regards




Mike H

Simple Macro... i guess
 
Hi,

This would select the last used cell in column C

Range("C" & Range("C65536").End(xlUp).Row).Select

Mike

"Vincent" wrote:

Hi everyone,

I´m a noob at VBA, so sorry if i offend anyone:)

I want a macro that goes to the last written cell of a column.
I tried:

Sub Macro 1

Max(Range("C:C")).Select

End Sub

Wich obviously didn´t work. In column C i had to insert the function
IF(B="";"";row()) in order to have the maximum value matching the last
written cell in column B.
I wanted that macro to send me to the maximum value of column C :)

Best Regards


Don Guillett

Simple Macro... i guess
 

cells(rows.count,"c").end(xlup).select
but selections are usually NOT necessary OR desirable.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Vincent" wrote in message
...
Hi everyone,

I´m a noob at VBA, so sorry if i offend anyone:)

I want a macro that goes to the last written cell of a column.
I tried:

Sub Macro 1

Max(Range("C:C")).Select

End Sub

Wich obviously didn´t work. In column C i had to insert the function
IF(B="";"";row()) in order to have the maximum value matching the last
written cell in column B.
I wanted that macro to send me to the maximum value of column C :)

Best Regards



Vincent

Simple Macro... i guess
 
Thanks a lot for your help. Maybe i´ll study a bit VBA now :)


All times are GMT +1. The time now is 09:54 AM.

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