View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Crowbar via OfficeKB.com Crowbar via OfficeKB.com is offline
external usenet poster
 
Posts: 128
Default assign value to range

This will do it, its configured for sheet 2 but you will get my idea

If you want my test workbook I can email it to you

prec

Sub Macro2()

Dim LastRow
LastRow = Sheet2.UsedRange.Row + 1 _
+ Sheet2.UsedRange.Rows.Count

For x = 1 To LastRow

If Val(Sheet2.Cells(x, 1).Value) "0" And Val(Sheet2.Cells(x, 1).Value)
< "11" Then
Sheet2.Range("B" & x).Value = "Engalnd"
ElseIf Val(Sheet2.Cells(x, 1).Value) "10" And Val(Sheet2.Cells(x, 1).
Value) < "21" Then
Sheet2.Range("B" & x).Value = "Scotland"
ElseIf Val(Sheet2.Cells(x, 1).Value) "20" And Val(Sheet2.Cells(x, 1).
Value) < "31" Then
Sheet2.Range("B" & x).Value = "Ireland"
End If
Next

End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1