Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro will not carry zero's over to web form. 1

Status
Not open for further replies.

DrMingle

Technical User
May 24, 2009
116
US
This --> Name = Range("I14")<-- is for a zip code, in Excel the cell is formated special so I can lead with a zero when needed...however when I use sendkeys it for whatever reason is not copying the zeros such as 07211, 07064, 07067 etc. The zero's which lead the five digit numbers are not present...


'*******************Rev Search
objIERev.navigate2 "objIERev.Visible = True
Application.Wait (Now + TimeValue("0:00:1"))
While objIERev.busy
Wend
objIERev.Visible = True
WshShell.AppActivate "Name or Category"
Application.Wait (Now + TimeValue("0:00:1"))
'***************Zip
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.SendKeys "{Tab}"
WshShell.AppActivate "Name or Category"
Name = Range("I14")
WshShell.SendKeys Name
 
it wont be the sendkeys which is dropping the zeros, it wont be doing an implicit CInt or CDbl (well i doubt it very much). do a Wscript.Echo of Name before using it with sendkeys and see what you are getting back from Name = Range("I14"). perhaps format the 07990 cells as text
 
Replace this:
Name = Range("I14")
with this:
Name = Range("I14").Text

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top