LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Appending new data to existing data in a spreadsheet

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Data from a pre-existing spreadsheet Todd Helmick Excel Discussion (Misc queries) 2 July 23rd 09 01:13 PM
Appending Data from one spreadsheet to another GeorgeA Excel Discussion (Misc queries) 4 June 22nd 09 03:11 PM
How can I organize/transfer existing data into a new spreadsheet? PaddyR Excel Discussion (Misc queries) 1 November 13th 08 03:27 AM
Appending data from one spreadsheet to another using a macro DebP Excel Discussion (Misc queries) 3 December 1st 05 03:11 PM
Creating a summary from existing spreadsheet data ... NP Excel Worksheet Functions 8 October 29th 04 02:39 PM


All times are GMT +1. The time now is 01:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"