Don Guillett
3/26/2010 6:54:00 PM
However, if you have text or the "dreaded space bar" in the cell then you
will still get 1000 ......
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett@gmail.com
"MovingBeyondtheRecordButton"
<MovingBeyondtheRecordButton@discussions.microsoft.com> wrote in message
news:05A7D95A-CEC7-406A-89AE-888224BDAF03@microsoft.com...
>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
>> dguillett@gmail.com
>> "MovingBeyondtheRecordButton"
>> <MovingBeyondtheRecordButton@discussions.microsoft.com> wrote in message
>> news:A486B6A6-9EAD-4ECA-A640-392FB8119773@microsoft.com...
>> > 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
>> >
>> >
>> >
>>
>> .
>>