Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find and print in new sheet

I want to make an function that looks for an number in one worksheet and copy
it in a new worksheet. like IF(A1=2;"testing";"0") but i dont want it to
write 0 or leave the line empty and jump down,
For exampel if a1= 1 then write b1 and d1
If a2=2 dont write anything but find next 1 and write that on next row in
new worksheet.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find and print in new sheet

Sub ABCD()
Dim k as Long, cell as Range, rng as Range
k = 1
set rng = Worksheets("Sheet2").Range("A1")
with worksheets("sheet1")
for each cell in .Range("A1:A20")
if cell.Value = 1 then
rng(k,1) = cell.offset(0,1)
rng(k,2) = cell.offset(0,3)
k = k + 1
end if
Next
End with
End Sub


--
Regards,
Tom Ogilvy

"SajberSmurf" wrote in message
...
I want to make an function that looks for an number in one worksheet and

copy
it in a new worksheet. like IF(A1=2;"testing";"0") but i dont want it to
write 0 or leave the line empty and jump down,
For exampel if a1= 1 then write b1 and d1
If a2=2 dont write anything but find next 1 and write that on next row in
new worksheet.



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
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
Why do I get a print error light trying to print an excel sheet ? SMC Excel Discussion (Misc queries) 2 November 5th 05 01:36 AM
How do I copy a print format from sheet to sheet in excel ? kernat Excel Discussion (Misc queries) 1 July 22nd 05 04:59 PM
I want to print out the sheet tabs (sheet names) Sundus Excel Worksheet Functions 3 February 23rd 05 08:34 PM
after each print, copy data from sheet 1 to sheet 2 tvtrav Excel Programming 6 April 6th 04 06:00 PM


All times are GMT +1. The time now is 09:18 PM.

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"