LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Recognize first emtpy Cell in column

try:

Dim rng As Range, wbk As Workbook
ActiveSheet.UsedRange.EntireColumn.AutoFit
ActiveSheet.Range("c1").Sort _
Key1:=ActiveSheet.Columns("c"), _
Header:=xlYes
Set rng = ActiveSheet.UsedRange
Set wbk = Workbooks.Open("C:\Documents and
Settings\User\Desktop\ALLTIE.xls", , False)
rng.Copy wbk.ActiveSheet.Cells
Set rng = Nothing

--
http://www.vba.com.tw/plog/


"JohnDK" wrote:
[color=blue]

How can i code to copy range (which is not always going to be the same)
from one book.sheet to another. The code would have to look for the
first emtpy cell in
the latter book, and thenn paste.
Currently i select all cells (which i dont want, i need to select all
data cells without header row) and paste in new book after selecting
range. Range is dynamic , so i have to code to look for first emtpy
cell where i need to paste.

any ideas.
Thanx

[color=RoyalBlue]ActiveSheet.Cells.Select
ActiveSheet.Cells.EntireColumn.AutoFit
ActiveSheet.Range("c1").Sort _
Key1:=ActiveSheet.Columns("c"), _
Header:=xlYes
ActiveSheet.Cells.Select
Selection.Copy

Workbooks.Open "C:\Documents and Settings\User\Desktop\ALLTIE.xls", ,
False
AppActivate "Microsoft Excel"ActiveSheet.Cells.Select
ActiveSheet.Paste


--
JohnDK
------------------------------------------------------------------------
JohnDK's Profile: http://www.excelforum.com/member.php...fo&userid=7184
View this thread: http://www.excelforum.com/showthread...hreadid=482406




 
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
Vlookups don't recognize text to column cells - why? Karen Excel Discussion (Misc queries) 4 July 14th 09 09:51 PM
Active Hide Emtpy Cells Asian Mike Excel Discussion (Misc queries) 1 January 31st 06 03:56 PM
emtpy cell Lee Excel Programming 2 August 15th 05 05:26 PM
insert amount into first emtpy cell derekc[_5_] Excel Programming 5 May 20th 04 03:49 AM
Hide row when cell is emtpy Hannes Heckner Excel Programming 2 March 5th 04 09:48 AM


All times are GMT +1. The time now is 09:40 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"