Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
if then nested in a for next ??
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
if then nested in a for next ??
Try it with: c.Formula =
instead of: c.Value = "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
if then nested in a for next ??
You had col=A instead of col ="A"
try this instead sub checkcol() mv= 21 - c.Column For Each c In Selection.Cells c.Value = "='C:\WB\[@@MYPAGE." & "-" & mv & ".-" & mv & " & "." & c.Row & "." & "11111.-11111.4" & ".xlsm]Sheet2'!$T$3" Next c end sub -- Don Guillett Microsoft MVP Excel SalesAid Software "pls123" wrote in message ... 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
if then nested in a for next ??
hi all ty for help !!
tom's solution works fine when i delete this Dim c As Range tty !! byy "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
nested if based on nested if in seperate sheet. how? | Excel Worksheet Functions | |||
Nested if | Excel Worksheet Functions | |||
NESTED IF | Excel Programming | |||
What is quicker? Nested or non nested ifs | Excel Programming | |||
Nested If(and(... | Excel Programming |