Solved

VBA to look in every sheet and

Posted on 2016-11-16
2
34 Views
Last Modified: 2016-11-16
Probably very easy but beyond me. I need VBA that will look on every sheet in workbook and if cell A2 is blank enter N/A in cell A2

Thanks in advance
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41889788
Hi,

Pls try
Sub macro()

For Each sh In Worksheets
    If sh.Range("A2") = "" Then sh.Range("A2").Formula = "=NA()"
Next
End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:Jagwarman
ID: 41889808
Thanks Rgonzo
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

713 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