![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Tim
Posts: 2
|
Hi all! I need a macro to clear the data fields in a workbook with 12 sheets of varying sizes (if that matters?).
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
Sub Jack()
' Written by Jack in the UK 16th May 2002 Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select ' Add in sheets / name of all sheets upto 12 Sheets("Sheet1").Activate 'just makes something active so code executes OK Selection.ClearContents ' Cleasr cells contence in one hit - gone Sheet1.Select Range("A1").Select ' just select any cell in sheet1 or whatever you name, ' I like to finish on a cell of some sort End Sub
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#3 |
|
Legend
Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,704
|
What do you mean by data fields? Cells?
If it's just cells, you don't have to select anything using:
_________________ Cheers, NateO ![]() [ This Message was edited by: NateO on 2002-05-15 11:55 ] |
|
|
|
|
|
#4 |
|
New Member
Join Date: May 2002
Location: Tim
Posts: 2
|
Thanks! Will try both options
Tim |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
|
Jack,
Its good to see commented code! If more people did it everyone would learn alot more. |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
ermmm
i copy a few guys really im very poor at scripts, i have folowed a guy call joe was he seem to know a bit Dave Hawley is my old pal, and my great friend Ivan F Moala these guys i like the style they use.. not taking a thing from the other GURUS, Mark suport Celtic so we call all ignor him even thou: hes MVP I keep saying Celtic will never win the world cup, and Mark swares he wares a skirt!
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
|
Me to Jack, Dave Hawley amazes me as does Ivan F Moala and I find Nate-O equally helpful. Aladdin as a sheet function man is the best I have ever seen. On the old board Dave helped me with some tough problems.
Mark O'Brien does good snippets and helps regularly. I should have remembered him right off, my wifes grandmother was an O'Brien. Juan writes killer code as well and knows some obscure tricks as well. So many people help out on this board that one could go on all day thanking the experts. JSW [ This Message was edited by: Joe Was on 2002-05-16 11:43 ] [ This Message was edited by: Joe Was on 2002-05-16 11:44 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|