View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Input Box only if a cell is blank

hi
if statemate......
Option Explicit
Private Sub Workbook_Open()
If WorkSheets("Summary").Range("A4").value = "" then
Dim ClientName As String
ClientName = InputBox("Please input the Client's Name")
Worksheets("Summary").Range("A4").value = ClientName
end if
End Sub

regards
FSt1

"Audrey" wrote:

Hi, I'm a VBA noob. At most I glean from the genius on this forum and copy
and paste your functions into my workbooks. I took a modified version of
this code directly from this forum, but I don't know how to change it so that
the input box will only pop up if the cell is blank.

Option Explicit
Private Sub Workbook_Open()

Dim ClientName As String

ClientName = InputBox("Please input the Client's Name")

Worksheets("Summary").Range("A4") = ClientName

End Sub

Also I only need the input box to pop up if the user is on the tab titled
"Summary," not as the book is opened.

Any help is greatly appreciated!

Thanks!