Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy data in new sheets from criteria using VBA


I have a huge database with a lot of 0 and 1.

When there is the number 1, I would like to copy in a new sheet th
name of the line (which is a time) and that, for every row.

I attached a part of my database to this message and here is a
example. In the row L, the number 1 appears twice. I'd like to have, i
the sheet "Horaires", 0 and 525, which appear in column C.

I think the best way to do this is using VBA but my knowledge of VBA i
too low. I need some guidelines to get through it

+-------------------------------------------------------------------
|Filename: ex.zip
|Download: http://www.excelforum.com/attachment.php?postid=4475
+-------------------------------------------------------------------

--
bambinos8
-----------------------------------------------------------------------
bambinos83's Profile: http://www.excelforum.com/member.php...fo&userid=3258
View this thread: http://www.excelforum.com/showthread.php?threadid=52387

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Copy data in new sheets from criteria using VBA

Could you give an example of what you expect in sheet "Horaires" ?

TIA
--
AP

"bambinos83" a
écrit dans le message de
...

I have a huge database with a lot of 0 and 1.

When there is the number 1, I would like to copy in a new sheet the
name of the line (which is a time) and that, for every row.

I attached a part of my database to this message and here is an
example. In the row L, the number 1 appears twice. I'd like to have, in
the sheet "Horaires", 0 and 525, which appear in column C.

I think the best way to do this is using VBA but my knowledge of VBA is
too low. I need some guidelines to get through it.


+-------------------------------------------------------------------+
|Filename: ex.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4475 |
+-------------------------------------------------------------------+

--
bambinos83
------------------------------------------------------------------------
bambinos83's Profile:

http://www.excelforum.com/member.php...o&userid=32589
View this thread: http://www.excelforum.com/showthread...hreadid=523875



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy data in new sheets from criteria using VBA


I modified the sheet "Horaires" in the foloowing worksheet with a
example of what I'd like to have

+-------------------------------------------------------------------
|Filename: ex.zip
|Download: http://www.excelforum.com/attachment.php?postid=4476
+-------------------------------------------------------------------

--
bambinos8
-----------------------------------------------------------------------
bambinos83's Profile: http://www.excelforum.com/member.php...fo&userid=3258
View this thread: http://www.excelforum.com/showthread.php?threadid=52387

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Copy data in new sheets from criteria using VBA

Voici la macro:

Cordialement,
--
AP

'----------------------------------
Sub transpose()
Dim rHeureVoyage As Range
Dim rTrace As Range
Worksheets("Test").Activate 'Make it active sheet
For Each rHeureVoyage In Range( _
Cells(4, "C"), _
Cells(Rows.Count, "C").End(xlUp))

For Each rTrace In Range( _
rHeureVoyage.Offset(0, 1), _
rHeureVoyage.Offset(0, 1).End(xlToRight))

If rTrace.Value = 1 Then
Set rdest = Worksheets("Horaires").Cells( _
3, _
rTrace.Column - 2)
Do While rdest.Value < ""
Set rdest = rdest.Offset(1, 0)
Loop
rdest.Value = rHeureVoyage.Value
End If
Next rTrace
Next rHeureVoyage
End Sub
'---------------------------------------
"bambinos83" a
écrit dans le message de
...

I modified the sheet "Horaires" in the foloowing worksheet with an
example of what I'd like to have.


+-------------------------------------------------------------------+
|Filename: ex.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4476 |
+-------------------------------------------------------------------+

--
bambinos83
------------------------------------------------------------------------
bambinos83's Profile:

http://www.excelforum.com/member.php...o&userid=32589
View this thread: http://www.excelforum.com/showthread...hreadid=523875



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy data in new sheets from criteria using VBA


Wow. Merci beaucoup... Thanks a lot!! This is great and it will save m
loads of time!! I have another issue with VBA but I won't abuse fro
you... I'll give it a shot!

Thanks again! :) :) :

--
bambinos8
-----------------------------------------------------------------------
bambinos83's Profile: http://www.excelforum.com/member.php...fo&userid=3258
View this thread: http://www.excelforum.com/showthread.php?threadid=52387



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Copy data in new sheets from criteria using VBA

Come on, I've got plenty of time...

Cheers
--
AP

"bambinos83" a
écrit dans le message de
...

Wow. Merci beaucoup... Thanks a lot!! This is great and it will save me
loads of time!! I have another issue with VBA but I won't abuse from
you... I'll give it a shot!

Thanks again! :) :) :)


--
bambinos83
------------------------------------------------------------------------
bambinos83's Profile:

http://www.excelforum.com/member.php...o&userid=32589
View this thread: http://www.excelforum.com/showthread...hreadid=523875



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
Copy data to different sheets James Merrill Excel Worksheet Functions 6 November 12th 09 06:19 AM
Copy data to another wb based on specific criteria ksh Excel Discussion (Misc queries) 1 October 29th 07 01:30 PM
copy data with criteria linda Excel Discussion (Misc queries) 4 September 10th 07 09:22 AM
in VBA Sheets("mysheet").Copy Befo=Sheets(1) how do i get a reference to the newly created copy of this sheet? Daniel Excel Worksheet Functions 1 July 6th 05 09:57 PM
under certain criteria copy data. dave Excel Worksheet Functions 2 November 16th 04 02:56 AM


All times are GMT +1. The time now is 04:56 PM.

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"