Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default macro to enter data into different line

i have a few data in different line.. and want copy all the data into new
sheet using macro. and for next data I wanted the macro to copy to a new line
(empty line / next line after first copied data). Let say i click copy button
3 time the data will insert into new sheet in continues line and not replace
the same line.

thank you in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default macro to enter data into different line

The code will look something like the code below. there are two different
row counters. One counter fro the row where the data is located and a second
row counter for the destination sheet.


with sheets("New Sheet")
LastRow = .Range("A" & Rows.Count).end(xlup).Row
NewRow = LastRow + 1
end with

with activesheet
RowCount = 1
Do while Activesheet.Range("A" & RowCount) < ""

if "some test"

.Rows(RowCount).copy destination:=sheets("New Sheet").Rows(NewRow)
NewRow = NewRow + 1
end if

RowCount = RowCount + 1
loop
end with

"ramzi" wrote:

i have a few data in different line.. and want copy all the data into new
sheet using macro. and for next data I wanted the macro to copy to a new line
(empty line / next line after first copied data). Let say i click copy button
3 time the data will insert into new sheet in continues line and not replace
the same line.

thank you in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default macro to enter data into different line

dear Joel,

Thank you, it works with few modification to suite my program.

thanks

"Joel" wrote:

The code will look something like the code below. there are two different
row counters. One counter fro the row where the data is located and a second
row counter for the destination sheet.


with sheets("New Sheet")
LastRow = .Range("A" & Rows.Count).end(xlup).Row
NewRow = LastRow + 1
end with

with activesheet
RowCount = 1
Do while Activesheet.Range("A" & RowCount) < ""

if "some test"

.Rows(RowCount).copy destination:=sheets("New Sheet").Rows(NewRow)
NewRow = NewRow + 1
end if

RowCount = RowCount + 1
loop
end with

"ramzi" wrote:

i have a few data in different line.. and want copy all the data into new
sheet using macro. and for next data I wanted the macro to copy to a new line
(empty line / next line after first copied data). Let say i click copy button
3 time the data will insert into new sheet in continues line and not replace
the same line.

thank you in advance

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
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
how do I remove fx from the function line, can't enter data dmdranch New Users to Excel 4 December 3rd 05 06:52 PM
enter data in cell which will start macro to move data to sheet2 Tommy Excel Discussion (Misc queries) 0 May 12th 05 05:00 PM
enter data in cell then run macro automatically R D S Excel Discussion (Misc queries) 2 January 25th 05 10:19 PM
one line macro to enter password for workbook N Lenox Excel Programming 5 October 29th 03 08:36 PM


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