Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way to tell Excel to just go to the end of the populated cells -
either row or column? I have a number of situations where I know the start, but not the end of a range. For example, I need to set an entire worksheet (except the first column) to NumberFormat = "0.0000" I've tried this: xlapp.Workbooks(strXlsFile).Worksheets(sn(i)).Rang e("B2").End(xlToRight).Num berFormat = "0.0000" but no luck. I also need to insert a formula in a column, but I don't know how many rows it will have. This works: xlapp.Workbooks(strXlsFile).Worksheets(sn(i)).Rang e("D2:D76").Formula = "=STDEV(E2:AH2)" but I've hardcoded the range. I know it will start at D2, but I don't know that it will always end at D76. I found this code: Private Function LastRow() As Long LastRow = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row End Function But I'm not sure if this is the right way to do it. Any suggestions welcome! Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FInd common data in one column then add number in adjacent column | Excel Worksheet Functions | |||
find last row value in column when using MATCH to find column | Excel Worksheet Functions | |||
Find something in column a then find if column B matches criteria | Excel Discussion (Misc queries) | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
Need Macro to Find Column Heading -- if none, then insert new column | Excel Programming |