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

H

harpscardiff

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
 
B

Bob Phillips

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.


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"harpscardiff" <[email protected]>
wrote in message
news:[email protected]...
 
P

pianoman

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,
 
H

harpscardiff

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?
 
H

harpscardiff

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top