Entering Worksheet range Value into Macro Scrpt

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to enter in macro cod a value from a worksheet rang
the worksheet range is "AL2"; value in range can be a number or date
I believe following code in macro enters value into macr

Range(Range("AL2")).value.selec

When editing macro want to know value or date that has been entered
Need code to display in macro what has been entered
Also, what code uses that value so it can be used with other code

Thank
Bob Leonar
(e-mail address removed)
 
One approach:

Sub test()
Dim var As Variant

var = Range("AL2").Value

If VarType(var) = vbDate Then
MsgBox Format(var, "dd-mmm-yyyy") & " is date"
ElseIf IsNumeric(var) Then
MsgBox var & " is number"
End If
End Sub
 
Rob
What I need is code to display in Macro when open for editing the value of AL2 which contains Row # 4

following is part of my code

' Before runing Macro must Edit the Row # the Scores are being entered in
' Range(Range("AL2")).Value.Selec
Dim var As Varian
var = Range("AL2").Valu
MsgBox var & "is number


'Highlight following code at this point, select EDIT, then Replace; in Replac
'Box in Find What area, enter Row # to find and replace; in Replace With area
'enter Row # where you want scores copied to

' Macro set up to enter Scores in Row
'3

'Displays Row # in workshee
'ValueRow = 3
Range("AJ22").Selec
ActiveCell.Value = 3
'ActiveCell.Formula = ValueRo

'Team
Range("c36").Selec
'Application.Goto Reference:="R36C3" 'c3
ActiveCell.Formula = Value01
Range("i36").Selec
'Application.Goto Reference:="R36C9" 'i3
ActiveCell.Formula = Value01

Range("p36").Selec
'Application.Goto Reference:="R36C16" 'p3
ActiveCell.Formula = Value02
Range("v36").Selec
'Application.Goto Reference:="R36C22" 'v3
ActiveCell.Formula = Value02
'Team

Thanks for your hel
Bob Leonard
 

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

Back
Top