Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crazy Data Validation ... List Validation Not Working TW Bake Excel Programming 1 March 29th 07 02:41 AM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
Validation (Drop down list vs simple text length validation) Bob Phillips[_6_] Excel Programming 2 April 27th 04 07:47 PM
Validation (Drop down list vs simple text length validation) Jason Morin[_2_] Excel Programming 1 April 27th 04 04:56 PM
Validation (Drop down list vs simple text length validation) Pete McCosh Excel Programming 0 April 27th 04 03:49 PM


All times are GMT +1. The time now is 04:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"