Thread: fill range
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default fill range

Try this:

Sub Zoek_Ban1()

Dim i As Integer
Dim j As Integer

With Range("A1")
Do While .Offset(i, 0).Value < Empty
If .Offset(i, 0).Value 23 Then
For j = 1 To 10
.Offset(i, j).Value = .Offset(i, j).Value * 0.75 / 100
Next j
Else
For j = 1 To 10
.Offset(i, j).Value = .Offset(i, j).Value + 13.08
Next j
End If

i = i + 1
Loop
End With

End Sub

"Basta1980" wrote:

Hi all,

See code below. How do I add a command that performs not only a calculation
on activecell.offset(0,1), which is in this case B1, but also calculates C1
through to K1?!

Sub Zoek_Ban1()

Range("A1").Select
Do While ActiveCell.Value < Empty
If ActiveCell.Offset(0, 0).Value 23 Then
ActiveCell.Offset(0, 1).Value = (ActiveCell.Offset(0, 1).Value / 100) *
0.75
ElseIf ActiveCell.Offset(0, 0).Value < 23 Then
ActiveCell.Offset(0, 1).Value = ActiveCell.Offset(0, 1).Value + 13.08
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub

Regards,

Basta1980