Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
excelmonkey
here are 2 ways to get vacant row & column numbers. Watch the auto word wraps. RowNo = Range("a" & Rows.Count).End(xlUp).Row + 1 ColNo = Cells(1, Columns.Count).End(xlToLeft).Column + 1 GetBottomRow = TheSheet.Cells.Find(What:="*", SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row + 1 LastColumn = TheSheet.Cells.Find(What:="*", SearchOrder:=xlByColumns _ SearchDirection:=xlPrevious).Column + 1 The following code gives 3 examples of using offset sub TestOffset() Dim GetBottomRow As Long Dim LastColumn As Integer GetBottomRow = Cells.Find(What:="*", SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row LastColumn = Cells.Find(What:="*", SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious).Column Range("a1").Offset(GetBottomRow) = "hi" Range("a1").Offset(GetBottomRow, LastColumn) = "abc" Range("a1").Offset(0, LastColumn) = "welcome" End Su -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Importing Data from a pre-existing spreadsheet | Excel Discussion (Misc queries) | |||
Appending Data from one spreadsheet to another | Excel Discussion (Misc queries) | |||
How can I organize/transfer existing data into a new spreadsheet? | Excel Discussion (Misc queries) | |||
Appending data from one spreadsheet to another using a macro | Excel Discussion (Misc queries) | |||
Creating a summary from existing spreadsheet data ... | Excel Worksheet Functions |