• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 51
  • Last Modified:

VBA to look in every sheet and

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
Jagwarman
Asked:
Jagwarman
1 Solution
 
Rgonzo1971Commented:
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
 
JagwarmanAuthor Commented:
Thanks Rgonzo
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now