LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Simplify this macro

Afternoon,

Can anybody help to simplify this macro.

Instead of all the sheet names, possible to either group them or name range
them?

Application.Run "Template.xls!CreateSheets.CreateSheets"
Sheets("Template").Select
Cells.Select
Selection.Copy
Sheets("Buda, S (LD002)").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Buda, S (LD002)", "Chakela, P (LD075)", "Chauke, H
(LD011)", _
"Dube, T (D838)", "Kasoka, T (D837)", "Ketsiwe, L (LD097)",
"Koatsane, G (LD105)", _
"Lebusa, T (LD103)", "Lekgowane, H (VD9027)", "Lombard, P (LD096)", _
"Mabilo, S (LD045A)", "Mahlangu, B (LD067)", "Mahlangu, M (LD021)", _
"Mahloko, J (LD098)", "Makhongoana, J (LD077)", "Makurumidze, C
(LD108)", _
"Malatji, D (LD100)", "Malaza, D (LD085)", "Malindi, A (LD039)", _
"Mangena, P (LD051)", "Mankwane, N (LD102)", "Maphanga, J (LD070)", _
"Maphanga, M (LD005)", "Maseko, D (D448)", "Mashaba, M
(LD033)")).Select
Sheets("Buda, S (LD002)").Activate
Sheets(Array("Masondo, J (LD069)", "Mathe, N (LD049)", "Mathebula, V
(LD054)", _
"Mathumba, J (LD053)", "Mbongo, L (LD095)", "Mhlongo, D (LD072)", _
"Mkhondo, F (LD086)", "Mkhwanazi, S (D832)", "Mlawuza, F (D821)", _
"Mohlala, J (LD015)", "Mohlala, N (LD104)", "Moloi, M (D681)",
"Moloi, M (D714)", _
"Myeni, P (LD109)", "Ndala, J (LD112)", "Ndhlovu, M (D831)",
"Ndlovu, R (LD084)", _
"Ngakane, P (LD030)", "Ngodela, I (LD107)", "Ngoma, G (LD065)", _
"Nhlapo, M (LD080)", "Nkosi, B (LD079)", "Nonyane, O (LD111)",
"Phiri, O (LD087)", _
"Phora, P (LD106)")).Select Replace:=False
Sheets(Array("Radebe, R (LD094)", "Sangweni, Z (LD060)", "Sebata, M
(LD058)", _
"Sebolai, S (LD082)", "Segonyela, W (LD025)", "Serobedi, M (LD071)", _
"Sithole, S (LD083)", "Skhosana, B (VD9056)", "Thabasine, G
(LD008)", _
"Tsotetsi, W (LD068)", "Vubu, T (D843)", "Woite, G (LD089)", "Zakwe,
Z (VD9025)", _
"Zulu, N (LD055)", "Gidinabokao, T (LD116)", "Lukhele, L (LD115)", _
"Mabena, C (LD113)", "Malebe, C (LD119)", "Maluka, V (LD121)", _
"Malumane, C (LD123)", "Maposa, M (LD122)", "Masango, M (LD118)", _
"Masia, L (LD120)", "Mathenjwa, S (LD117)", "Mogokane, M
(LD114)")).Select _
Replace:=False
Cells.Select
ActiveSheet.Paste
ActiveSheet.Paste
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Parameters").Select
Application.CutCopyMode = False
End Sub

And also there is no guarantee that Sheet Buda, S (LD002) will always be the
first one selected.

Thanks
 
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 email amacro? leo Excel Worksheet Functions 24 August 9th 06 02:47 PM
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM


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