Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Entering Worksheet range Value into Macro Scrpt

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Entering Worksheet range Value into Macro Scrpt

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 van Gelder - http://www.vangelder.co.nz/excel


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

Range(Range("AL2")).value.select

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?

Thanks
Bob Leonard



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Entering Worksheet range Value into Macro Scrpt

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

NEED TO DISPLAY VALUE OF WORKSHEET RANGE "AL2" HERE SO KNOW WHAT TO CHANGE 36 TO


FOR EXAMPLE CURRENT ROW TO POST IS: 4


' 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
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
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
Entering numerical range Vi Excel Discussion (Misc queries) 5 July 6th 07 10:38 PM
Entering a range of numbers and searching same Penny Excel Discussion (Misc queries) 28 May 10th 06 03:38 PM
Macro to print a selected range, not entire worksheet James C Excel Discussion (Misc queries) 3 October 19th 05 10:12 PM
How? Macro to copy range to new worksheet, name new worksheet, loop Repoman Excel Programming 9 October 9th 03 01:45 PM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"