Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Everybody,
Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() LastCell = Cells(Rows.Count,"A").End(xlUp) -- HTH Bob Phillips "sisco98" wrote in message ... Hi Everybody, Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi sisco98,
You can try one of these: 1) Sub Test1() Cells(Rows.Count, "A").End(xlUp).Select End Sub 2) Sub Test2() Range("A:A").Find("*", Cells(1), _ xlValues, xlWhole, xlByRows, xlPrevious).Select End Sub Regards, KL "sisco98" wrote in message ... Hi Everybody, Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use:
range("A65536").End(xlUp).select to select the row range("A65536").End(xlUp).row for the row number range("A65536").End(xlUp).address for the cell address Mangesh "sisco98" wrote in message ... Hi Everybody, Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You will find the last used cell by looking up the first used cell fro the bottom, so the last used cell in column A would be myValue = Activesheet.Columns(1).Cells(65536).End(xlUp).Valu e Regards, Ton Teun -- Ton ----------------------------------------------------------------------- TonT's Profile: http://www.officehelp.in/member.php?userid=4 View this thread: http://www.officehelp.in/showthread.php?t=65563 Visit - http://www.officehelp.in/archive/index.php | http://www.officehelp.in/index/index.ph |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi TonT,
Thank you for your fast help! Kind regards -- sisco98 "TonT" wrote: You will find the last used cell by looking up the first used cell from the bottom, so the last used cell in column A would be myValue = Activesheet.Columns(1).Cells(65536).End(xlUp).Valu e Regards, Ton Teuns -- TonT ------------------------------------------------------------------------ TonT's Profile: http://www.officehelp.in/member.php?userid=47 View this thread: http://www.officehelp.in/showthread.php?t=655633 Visit - http://www.officehelp.in/archive/index.php | http://www.officehelp.in/index/index.php |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mangesh,
thanks for your help! Regards -- sisco98 "Mangesh Yadav" wrote: Use: range("A65536").End(xlUp).select to select the row range("A65536").End(xlUp).row for the row number range("A65536").End(xlUp).address for the cell address Mangesh "sisco98" wrote in message ... Hi Everybody, Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
Thank you for your help, regards -- sisco98 "Bob Phillips" wrote: LastCell = Cells(Rows.Count,"A").End(xlUp) -- HTH Bob Phillips "sisco98" wrote in message ... Hi Everybody, Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello KL,
thanks for quick help! regards -- sisco98 "KL" wrote: Hi sisco98, You can try one of these: 1) Sub Test1() Cells(Rows.Count, "A").End(xlUp).Select End Sub 2) Sub Test2() Range("A:A").Find("*", Cells(1), _ xlValues, xlWhole, xlByRows, xlPrevious).Select End Sub Regards, KL "sisco98" wrote in message ... Hi Everybody, Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Some of the replies have 65536 as the maximum number of rows in an
Excel worksheet. The number of rows has varied in the past and could change again. so it would be better to use Rows.Count as in the other replies. You might find it more useful with a toolbar button see http://www.mvps.org/dmcritchie/excel...ars.htm#macros the macro GotoBottomofCurrentColumn and you can use the button icon shown at the far right. of the macro. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "sisco98" wrote in message ... Hi Everybody, Does anyone know a way to select the last used cell in a column by using macro? For example, there is a range filled with data from "A1" to "A30", but the closing cell is always changing (A32,A36...). I would like to find the last data in column "A" by using VLOOKUP automatically. Thank you in advance for your help, sisco98 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) | |||
data validation to restrict input in cell based on value of cell above that cell | Excel Programming |