Solved

VBA to look in every sheet and

Posted on 2016-11-16
2
20 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 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
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
Comment Utility
Thanks Rgonzo
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

772 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

9 Experts available now in Live!

Get 1:1 Help Now