PC Review


Reply
 
 
Raul Sousa
Guest
Posts: n/a
 
      10th Apr 2008
Hello
I have a file with several sheets. Every sheet has its name, like “home”;
“job”; etc.
I need to copy into a new sheet all sheet names and cell.
For example: I need in cell b2, sheet1 name; in cell b3, sheet2 name; in
cell b4, sheet3 name, etc.
Then, I need, in cell c2, sheet1 cell b9 data, in cell c3, sheet2 cell b9
data, in cell c4, sheet3 cell b9 data, etc.
I think this can be done thought a cyclic code. I can’t create this code.
So, any help is most welcome.

 
Reply With Quote
 
 
 
 
Tom Hutchins
Guest
Posts: n/a
 
      10th Apr 2008
Try this macro. Paste this code in a VBA module in your workbook:

Sub ListSheets()
'Lists all the worksheets in the current workbook.
'Declare variables for this macro.
Dim xx As Integer, NewWS As Worksheet
On Error GoTo LSerr1
'Add a new worksheet
Set NewWS = ActiveWorkbook.Sheets.Add(after:=Worksheets(Worksheets.Count))
For xx% = 1 To (Sheets.Count - 1)
NewWS.Cells(xx% + 1, 1).Value = Sheets(xx%).Name
NewWS.Cells(xx% + 1, 2).Value = Sheets(xx%).Range("B9").Value
Next xx%
'Done. Add headings for the output rows
NewWS.Cells(1, 1).Value = "Sheets in " & ActiveWorkbook.Name
LS_CleanUp:
Set NewWS = Nothing
Exit Sub
LSerr1:
MsgBox "Could not list sheets", vbExclamation, "ListSheets error"
GoTo LS_CleanUp
End Sub

To run it, select Tools >> Macro >>Macros. Select ListSheets, then click Run.

If you are new to macros, this Jon Peltier link may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"Raul Sousa" wrote:

> Hello
> I have a file with several sheets. Every sheet has its name, like “home”;
> “job”; etc.
> I need to copy into a new sheet all sheet names and cell.
> For example: I need in cell b2, sheet1 name; in cell b3, sheet2 name; in
> cell b4, sheet3 name, etc.
> Then, I need, in cell c2, sheet1 cell b9 data, in cell c3, sheet2 cell b9
> data, in cell c4, sheet3 cell b9 data, etc.
> I think this can be done thought a cyclic code. I can’t create this code.
> So, any help is most welcome.
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot copy file: Data error (cyclic redundancy check). =?Utf-8?B?RGVzZXJ0QmFiZQ==?= Windows XP General 0 16th Jul 2007 08:24 PM
XP dual installation..error: can not copy cyclic redundancy =?Utf-8?B?U2FuZHJhIExlZQ==?= Windows XP Basics 2 24th Jan 2005 09:08 PM
Cannot Copy*.*: Data Error (cyclic redundancy check). Bobby77501 Windows XP General 1 28th Jul 2003 11:59 PM
Cannot Copy*.*: Data Error (cyclic redundancy check). Bobby77501 Windows XP General 0 28th Jul 2003 02:05 AM
Cannot copy my outlook.pst file - cyclic redundancy error message Marsha Microsoft Outlook 0 22nd Jul 2003 04:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:19 AM.