Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Haven't fully tested my code - whats wrong with it????

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
harpscardiff - 24 May 2006 11:37 GMT
Code:
--------------------
   Public Sub HotTPassword()
 Dim irow As Long
 Dim mydate As Date
 Dim mytime
 Dim mycell
 mydate = Date
 mytime = Time
 
 Application.ScreenUpdating = False
 
 If Range("B4").Value = "" Then
 Range("B$").Select
 Else
 Range("B" & Row.Count).End(xlUp).Offset(1, 0).Select ' problem line????
 End If
 
 mycell = ActiveWorkbook.ActiveCell
 If mycell <> "" Then
 ActiveCell.Value = mydate 'Column B
 ActiveCell.Offset(0, 1).Value = mytime 'Column C
 ActiveCell.Offset(0, 3).Value = "User" 'Column F
 ActiveCell.Offset(0, 6).Value = "Password" 'Column L
 ActiveCell.Offset(0, 1).Value = "Credit Apps" 'Column M
 ActiveCell.Offset(0, 1).Value = "Password Expired, need to be reset" 'Column N
 ActiveCell.Offset(0, 4).Value = "Verified Closed" 'Column R
 ActiveCell.Offset(0, 1).Value = "Medium" 'Column S
 ActiveCell.Offset(0, 1).Value = "IT Support" 'Column T
 ActiveCell.Offset(0, 2).Value = "Password Reset and Informed user." 'Column V
 ActiveCell.Offset(0, 1).Value = "IT Support" 'Column W
 ActiveCell.Offset(0, 1).Value = mydate 'Column X
 ActiveCell.Offset(0, 1).Value = mytime 'Column Y
 
 Application.ScreenUpdating = True
 End If
 End Sub
--------------------

Signature

harpscardiff

Bob Phillips - 24 May 2006 11:48 GMT
I think you are being somewhat disingenuous to post code that you say you
have fully tested and expect us to work out what it is supposed to do, what
it is doing, and how to correct it.

Do more yourself or expect little.

This is rubbish though

If Range("B4").Value = "" Then
   Range("B$").Select
 Else
   Range("B" & Row.Count).End(xlUp).Offset(1, 0).Select ' problem line????
 End If

"B$" is not a proper range address, and it should be Rows.Count.

Signature

HTH

Bob Phillips

(remove xxx from email address if mailing direct)

> Code:
> --------------------
[quoted text clipped - 34 lines]
>   End Sub
> --------------------
pianoman - 24 May 2006 11:48 GMT
Hi,
Did you mean to reference B$ to lines above the problem line... can
vb output the row number for a reference like that?

Regards,

Signature

pianoman

harpscardiff - 24 May 2006 12:01 GMT
I've written a few little macros, and bascially i've taken bits from
different macros i've dont or got help.

So i don't really know why that is there, i suppose its to select
column?

not sure - does the rest make sense?

Signature

harpscardiff

harpscardiff - 24 May 2006 12:42 GMT
I do apologies for not giving you more detail - i just wanted that one
line rectified no the whole thing!!

I'm a novice at VBA and just struggling my way through it.

I've sorted out my code, and it works, just to sort out the offsets.

BTW - Bob Phillips - your attitude fcking stinks!! Sort your self
man!!:mad:

Piano Man Cheers for the input.

Signature

harpscardiff

Tom Ogilvy - 24 May 2006 14:51 GMT
while the medicine may not have been pleasant, Bob magnanimously gave you the
help you needed.  If you had simply said, I can't see the problem, but seem
to be having trouble with this line - I doubt you would have received
anything but the help you needed - so you invited criticism  by your own
implication that you were too lazy to do your own debugging rather than
simply saying you lacked the knowledge to fix it.

Signature

Regards,
Tom Ogilvy

> I do apologies for not giving you more detail - i just wanted that one
> line rectified no the whole thing!!
[quoted text clipped - 7 lines]
>
> Piano Man Cheers for the input.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.