Solved

# Covert Excel Formula to Workbook

Posted on 2011-03-11
288 Views
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
Question by:cpatte7372
• 3

LVL 81

Accepted Solution

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

ID: 35115571
Kev,

Thanks man......
0

Author Comment

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

ID: 35115958
Cheers
0

## Featured Post

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.