Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default import data after last line of data

I need to be able to import data from one worksheet to another. I am ok
with the macro to select and copy the new data from the source sheet, but I
need to be able to identify the last "occupied" row in the target sheet, so
as not to overwrite. Is there a simple way to do this? any help greatly
appreciated.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default import data after last line of data

hi,
not sure what you mean by "occupied" but if you mean select the last row of
data in a range then...

Range("A65000").end(xlup).offset(1,0).select

this would set you at the next empty cell, column A, ready to paste.

regards
FSt1

"mepetey" wrote:

I need to be able to import data from one worksheet to another. I am ok
with the macro to select and copy the new data from the source sheet, but I
need to be able to identify the last "occupied" row in the target sheet, so
as not to overwrite. Is there a simple way to do this? any help greatly
appreciated.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default import data after last line of data

Hi mepetey.
Try:

R = ActiveSheet.UsedRange.Rows.Count 'last row
C = ActiveSheet.UsedRange.Columns.Count 'last column

Regards
Eliano



"mepetey" wrote:

I need to be able to import data from one worksheet to another. I am ok
with the macro to select and copy the new data from the source sheet, but I
need to be able to identify the last "occupied" row in the target sheet, so
as not to overwrite. Is there a simple way to do this? any help greatly
appreciated.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default import data after last line of data

On Oct 24, 6:31 am, eliano wrote:
Hi mepetey.
Try:

R = ActiveSheet.UsedRange.Rows.Count 'last row
C = ActiveSheet.UsedRange.Columns.Count 'last column

Regards
Eliano



"mepetey" wrote:
I need to be able to import data from one worksheet to another. I am ok
with the macro to select and copy the new data from the source sheet, but I
need to be able to identify the last "occupied" row in the target sheet, so
as not to overwrite. Is there a simple way to do this? any help greatly
appreciated.- Hide quoted text -


- Show quoted text -


Hi,

Try this. Change the cell reference in Range("A1") to refer to your
desired location.
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "New"

Regards
TrevoseF

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default import data after last line of data

Perfect.!

Thanks TrevoseF



wrote in message
oups.com...
On Oct 24, 6:31 am, eliano wrote:
Hi mepetey.
Try:

R = ActiveSheet.UsedRange.Rows.Count 'last row
C = ActiveSheet.UsedRange.Columns.Count 'last column

Regards
Eliano



"mepetey" wrote:
I need to be able to import data from one worksheet to another. I am
ok
with the macro to select and copy the new data from the source sheet,
but I
need to be able to identify the last "occupied" row in the target
sheet, so
as not to overwrite. Is there a simple way to do this? any help
greatly
appreciated.- Hide quoted text -


- Show quoted text -


Hi,

Try this. Change the cell reference in Range("A1") to refer to your
desired location.
Range("A1").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = "New"

Regards
TrevoseF



Reply
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
Import Data, using a command line switch Balisteor Excel Discussion (Misc queries) 4 July 7th 09 06:46 PM
Excel 2003 data import wizard does not support line ends in fields ChrisLime Excel Discussion (Misc queries) 0 February 25th 09 12:07 PM
Import Data / Edit Data / Export Data in Excel Mathias Fritsch Excel Programming 0 July 19th 07 04:08 PM
PLEASE!! How can I un-grey the 'Data-Import External Data-Import Data' option ??? kirkm[_6_] Excel Programming 13 August 8th 06 10:01 AM
Import External Data w/ CSV & Line-Breaks ... Joe HM Excel Programming 4 April 13th 05 06:54 PM


All times are GMT +1. The time now is 08:29 AM.

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

About Us

"It's about Microsoft Excel"