Solved

Covert Excel Formula to Workbook

Posted on 2011-03-11
4
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 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