Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am working in Sheet2. The data is in Sheet1. I can not get the data in
column in the 15th column to initalize the "If" even if Textbox1.Text matches. For k= 1 to 100 If Sheets("Sheet1").Cells(k,15)=TextBox1.Text Then code... End if Next k |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried:
If Sheets("Sheet1").Cells(k,15)=Sheets("Sheet2").Text Box1.Text Then With Sheets("Sheet2") If Sheets("Sheet1").Cells(k,15)=.TextBox1.Text Then .... End With If Sheets("Sheet1").Cells(k,15)=TextBox1.Text Then Nothing worked. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Philosophaie wrote :
I am working in Sheet2. The data is in Sheet1. I can not get the data in column in the 15th column to initalize the "If" even if Textbox1.Text matches. For k= 1 to 100 If Sheets("Sheet1").Cells(k,15)=TextBox1.Text Then code... End if Next k Lots of possibilities here! What is in Cells(k, 15)? Have you tried specifying Cells(k, 15).Text since your evaluating it against text stored in the textbox? We need more info in order to know how to better help you! regards, -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd add the property:
If Sheets("Sheet1").Cells(k,15).value = Sheets("Sheet2").TextBox1.Text Then And maybe it's an upper/lower case difference: if lcase(Sheets("Sheet1").Cells(k,15).value) _ = lcase(Sheets("Sheet2").TextBox1.Text) Then If these don't help, I think you should try adding a msgbox before the line: msgbox "***" & Sheets("Sheet1").Cells(k,15).value & "***" _ & "***" & sheets("sheet2").textbox1.text & "***" To see if you can spot the difference. Philosophaie wrote: I tried: If Sheets("Sheet1").Cells(k,15)=Sheets("Sheet2").Text Box1.Text Then With Sheets("Sheet2") If Sheets("Sheet1").Cells(k,15)=.TextBox1.Text Then ... End With If Sheets("Sheet1").Cells(k,15)=TextBox1.Text Then Nothing worked. -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Already tried Cells(k,15).Text and .Value they did not work. I purposefully
put a number in the Textbox that exists many times in "Sheet1" row 15. Lots of possibilities here! What is in Cells(k, 15)? Have you tried specifying Cells(k, 15).Text since your evaluating it against text stored in the textbox? We need more info in order to know how to better help you! regards, -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Philosophaie has brought this to us :
Already tried Cells(k,15).Text and .Value they did not work. I purposefully put a number in the Textbox that exists many times in "Sheet1" row 15. Lots of possibilities here! What is in Cells(k, 15)? Have you tried specifying Cells(k, 15).Text since your evaluating it against text stored in the textbox? We need more info in order to know how to better help you! regards, -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc . Your code snippets work for me so I suspect that 'Not Cells(k, 15) = TextBox1.Text' is the case. Did you check for that? I ask because I don't see an 'Else' clause in your If construct. If for any reason VBA determines it's not equal then you'll have something to work with beyond just trying to figure out why '=' doesn't work. HTH -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to sheet1 data goes to sheet2 automaticaly ? | Excel Worksheet Functions | |||
copy data from sheet2 to sheet1 when sheet2 has variable # of rows | Excel Discussion (Misc queries) | |||
A1 Sheet2 is linked to A1 sheet1 so that user enters value(abc123) a1 sheet1 and A1 sheet2 is updated | Excel Programming | |||
copying data from sheet1 to sheet2 | Excel Worksheet Functions | |||
How To Retrieve Data from Sheet2 into Sheet1 | Excel Worksheet Functions |