Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
name validation
Hi Excel Gurus,
im looking to hava a small macro that checks if a cell that i designate as a cell to enter your name is empty. and if so, to have a input box ask for the name, and enter it into the cell. i know nothing about programming but im doing an effort here, this is the code i wrote: the thing is that when the inputbox comes up and i write some thing and hit ok, it doesnt put it in B1. Sub entername() name = Range("B1") B1 = name If B1 = "" Then B1 = InputBox("enter your name", "yourname here") Else MsgBox "name in place, continue(or something like that" End If End Sub what is this programming newbie doing wrong? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
name validation
try this
Sub entername() If b1 = "" Then b1 = InputBox("enter your name", "yourname here") Else MsgBox "name in place, continue(or something like that" End If Worksheets("Sheet1").Range("b1").Activate ActiveCell = b1 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Crazy Data Validation ... List Validation Not Working | Excel Programming | |||
data validation invalid in dynamic validation list | Excel Worksheet Functions | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming | |||
Validation (Drop down list vs simple text length validation) | Excel Programming |