View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default if then nested in a for next ??

Try

Dim c As Range
For Each c In Selection
If c.Column = 1 Then
c.Value = "='C:\WB\[@@MYPAGE." & "-20.-20" & "." & c.Row & "." &
"11111.-11111.4" & ".xlsm]Sheet2'!$T$3"
End If
If c.Column = 2 Then
c.Value = "='C:\WB\[@@MYPAGE." & "-19.-19" & "." & c.Row & "." &
"11111.-11111.4" & ".xlsm]Sheet2'!$T$3"
End If
Next

Hope this helps,

Hutch

"pls123" wrote:

Hi all i need this but it doesn't work like this... any suggestion ?? ty !!

For Each c In Selection.Cells

If Selection.Column = A Then
c.Value = "='C:\WB\[@@MYPAGE." & "-20.-20" & "." & c.Row & "." &
"11111.-11111.4" & ".xlsm]Sheet2'!$T$3"
End If
If Selection.Cells.Column = "B" Then
c.Value = "='C:\WB\[@@MYPAGE." & "-19.-19" & "." & c.Row & "." &
"11111.-11111.4" & ".xlsm]Sheet2'!$T$3"
End If
Next