Solved

Covert Excel Formula to Workbook

Posted on 2011-03-11
4
288 Views
Last Modified: 2012-05-11
Hi Experts,

Can someone show me how I would go about applying the following excel code to a workbook. At the moment it applies to a worksheet called 2 Bull Up 3 Bear Dwn 2 Bull Up, but I would like to be able to apply globally on all worksheets.

Sub zolumn()
   With Sheets("2 Bull Up 3 Bear Dwn 2 Bull Up")
      .Range("B2", .Cells(.Rows.Count, "B").End(xlUp)).ClearContents
   End With
End Sub

Cheers
0
Comment
Question by:cpatte7372
  • 3
4 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 35112890
Sub zolumn()
   Dim Worksheet As Worksheet
   For Each Worksheet In ThisWorkbook.Worksheets
       With Worksheet
           .Range("B2", .Cells(.Rows.Count, "B").End(xlUp)).ClearContents
       End With
   Next Worksheet
End Sub

Kevin
0
 

Author Comment

by:cpatte7372
ID: 35115571
Kev,

Thanks man......
0
 

Author Comment

by:cpatte7372
ID: 35115652
Kev/Experts,

Can someone please also convert the following globally across the workbook as Kevin did above?

Sub Part1()
    Dim lastrow As Long
   
    lastrow = Sheets("Stocks").Range("A" & Rows.Count).End(xlUp).Row
   
    Sheets("Stocks").Range("A1:A" & lastrow).Copy _
    Sheets("Four Lows Five High").Range("B1")
End Sub

Cheers
0
 

Author Closing Comment

by:cpatte7372
ID: 35115958
Cheers
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now