Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
please tell me the macro which can find last cell in a column
thank u so muc -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
x = the number of the column you are concerned with (column "A" = 1
column "B" = 2 etc.) last = Worksheets("Sheet1").UsedRange.Row - 1 Worksheets("Sheet1").UsedRange.Rows.Count Do Until Worksheets("Sheet1").Cells(last, x).Value < "" last = last - 1 Loo -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range colNum as Long
colNum = 1 set rng = cells(rows.count,colNum).End(xlup) -- Regards, Tom Ogilvy "vikram " wrote in message ... please tell me the macro which can find last cell in a column thank u so much --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel down assumes contiguous data (no empty cells). xlup doesn't.
-- Regards, Tom Ogilvy <question for you; "Ron" wrote in message ... Is there a reason why you prefer to use choose .End(xlup) vs .End(xldown) ----- Tom Ogilvy wrote: ----- Dim rng as Range colNum as Long colNum = 1 set rng = cells(rows.count,colNum).End(xlup) -- Regards, Tom Ogilvy "vikram " wrote in message ... please tell me the macro which can find last cell in a column thank u so much --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Note - not typical, but for example (column A):
if the only not empty cell in column A is A65536 (the last row of th sheet), then xlUp selects the cell A1 (the first row of the sheet) Jare -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No one said you shouldn't test your results.
-- Regards, Tom Ogilvy "Jarek " wrote in message ... Note - not typical, but for example (column A): if the only not empty cell in column A is A65536 (the last row of the sheet), then xlUp selects the cell A1 (the first row of the sheet) Jarek --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Identify which column 'Large' finds a match in | Excel Worksheet Functions | |||
MACRO which deletes a row, when it finds a specific number | Excel Discussion (Misc queries) | |||
Macro that Finds the First Value in a range using a Combobox (drop down menu) | Excel Worksheet Functions | |||
Create a macro that finds values then sorts | Excel Worksheet Functions | |||
macro that finds text and keeps only part of it | Excel Discussion (Misc queries) |