#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If .. Then

I'm trying to set up three coloumns called columns 1,2 and
3 that display names from another sheet "sheet 1" which
have the value 1 in any of or all of three different
columns. I want the names to appear in a list under the
column titles and this seems to be causing the problem.
Can anyone see what my problem is?

Thanks,

Bob

For i = 1 To 100
NextRow = Range("A1").Row + Range
("A1").CurrentRegion.Rows.Count
NextRow2 = Range("A2").Row + Range
("A2").CurrentRegion.Rows.Count
NextRow3 = Range("A3").Row + Range
("A3").CurrentRegion.Rows.Count
If Sheets("Sheet1").Range("A" & i).Value = 1 Then
Range("A1").Value = "Column 1": Cells(NextRow, 1) = Sheets
("Sheet1").Range("A" & i).Value
End If
If Sheets("Sheet1").Range("B" & i).Value = 1 Then
Range("B1").Value = "Column 2": Cells(NextRow2, 2) = Sheets
("Sheet1").Range("A" & i).Value
End If
If Sheets("Sheet1").Range("C" & i).Value = 1 Then
Range("C1").Value = "Column 3": Cells(NextRow3, 3) = Sheets
("Sheet1").Range("A" & i).Value
End If
Next i
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



All times are GMT +1. The time now is 08:51 PM.

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

About Us

"It's about Microsoft Excel"