View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
MovingBeyondtheRecordButton MovingBeyondtheRecordButton is offline
external usenet poster
 
Posts: 20
Default Another Easy Question

By name I as referring to Num in the post above.

"MovingBeyondtheRecordButton" wrote:

I decide to use:

For Each F In Worksheets("Sheet1").Range("A4:A40,F4:F40")
If F.Value < "" Then
Num = 1000 & F.Value
'Then take Num and run Sql Query


"Don Guillett" wrote:

I have no idea what you mean by "give a name". You would NOT want to name
each cell.

Sub addto()
dim f as range
For Each f In Worksheets("Sheet30").Range("A4:A40", "F4:F40")
If Len(Application.Trim(f)) 0 And IsNumeric(f) Then
f.Value = 1000 & f.Value
End If
Next f
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"MovingBeyondtheRecordButton"
.com wrote in message
...
How do I take the value from each cell defined in the
range("A4:A40,F4:F40")
and place 1000 before the value and give this new number a name.

Example:
Number in A4 is 37984
I want to use 100037984

I have tried...

Dim F As Range
Dim myNum As Variant
Dim Num As Long
Worksheets("Sheet1").Activate
For Each F In Range("A4:A40", "F4:F40")
myNum = F.Value
Num = myNum & 1000




.