Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default List Worksheets in seperate worksheet


Can anyone help me with this problem. I have a workbook based on th
attached workbook. It uses a macro to find data in worksheets with a
'x' in a column. What I need to do is , that when the the macro i
clicked, it puts which sheet the data came from in column E in th
special order worksheet.

Can anyone help

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

--
caoimhincrya
-----------------------------------------------------------------------
caoimhincryan's Profile: http://www.excelforum.com/member.php...fo&userid=2560
View this thread: http://www.excelforum.com/showthread.php?threadid=39086

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default List Worksheets in seperate worksheet

Try something like this:

Sub FIndXs()

Dim shReport As Worksheet, shRead As Worksheet
Dim lrow As Long, lwrite As Long

'Assume activesheet is teh report sheet
'(it will be if the code is run from a button on it)
Set shReport = ActiveSheet
lwrite = 2

'go thru each worksheet
For Each shRead In ActiveWorkbook.Sheets
'skip our report sheet
If Not shRead Is shReport Then
'go thru each row in the worksheet until we find an X
With shRead
For lrow = 1 To .UsedRange.Rows.Count
If LCase(.Cells(lrow, 3)) Like "*x*" Then
'write this data to our report sheet
Range(shReport.Cells(lwrite, 1), _
shReport.Cells(lwrite, 4)).Value = _
Range(.Cells(lrow, 1), .Cells(lrow, 4)).Value
'write name of source sheet
shReport.Cells(lwrite, 5) = shRead.Name
lwrite = lwrite + 1
End If
Next lrow
End With
End If
Next shRead

End Sub

caoimhincryan wrote:
Can anyone help me with this problem. I have a workbook based on the
attached workbook. It uses a macro to find data in worksheets with an
'x' in a column. What I need to do is , that when the the macro is
clicked, it puts which sheet the data came from in column E in the
special order worksheet.

Can anyone help?


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

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
How do I have seperate headers for seperate pages in 1 worksheet? JessicaDL Excel Discussion (Misc queries) 1 February 22nd 08 07:14 PM
Adding / deleting cells to worksheets from a seperate worksheet G. Dagger Excel Discussion (Misc queries) 0 January 4th 08 05:36 PM
Color format cells based on list in seperate worksheet [email protected] Excel Worksheet Functions 1 May 7th 06 05:07 AM
How do I seperate data from a pivot into seperate worksheets? Shannon Excel Discussion (Misc queries) 5 August 25th 05 06:07 AM
Macro to list info on seperate worksheet Oreg Excel Programming 1 May 10th 04 02:16 AM


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