Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I did NOT open your attachment. Please do NOT attach files to the ng. You
MAY be invited to send a file directly to a respondent but do not attach to ng. The sub I sent you will do what you asked. suppose you have in col A A, col B A and col C C the sub will put C in the cell in col A so, your "selection" should be the col A range you want. for each c in range(cells(1,1),cells(cells(65536).end(xlup).row, 1))) or for each c in range("a1:a"&range("a65536").end(xlup).row) "SolaSig AB" wrote in message ... After some Time is gone .... May it look like this one? Public strCnt As Integer Sub Chck4nms() Set strCnt = 1 /* debuger Ask heer for an Object! :( For Each c In ActiveCell.CurrentRegion.Cells If c = c.Offset(strCnt, 2) Then c.Offset(, 2) = c.Offset(strCnt, 3) Set strCnt = 1 ElseIf strCnt = 12 Then Set strCnt = 1 Next Else: strCnt = strCnt + 1 Next End Sub Please try. XLS is included on-Line "Don Guillett" wrote in message ... something like - untested for each c in selection if c=c.offset(,1)then c=c.offset(,2) next "SolaSig AB" wrote in message ... Hi All! Here is some Help asked, since I'm not familiar with Excel programming, I can't find an Answer for my problem. Here is the Problem: I need to replace come words in 1st.Cell with words from another 3rd.Cell if Content of the 1.st.Cell and the 2nd.Cells matches. Main problem is the Volume 25.000 Strings ? 15 Rows. As I understand the algorithm for this operation it may look like this: Get Ai Value Get Bj Value Compare Ai and Bj values for equality If true then get Cj Value and put to Ai Value; Next Ai (Ai++) If false then get next Bj (Bj++) Example: Before replacement A B C 1 RED RED R 2 BLUE BLUE B 3 BLUE 4 RED 5 BLUE after replacement A B C 1 R RED R 2 B BLUE B 3 B 4 R 5 B Thanks if there might be some ideas or help, On-Line |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Don,
Thanks but I actually didn't understand how to make this Sub. I have combined all your post and got following subs. But this don't work :( Here are two Subs, but I don't know what is wrong: Sub Chck() for each c in range(cells(1,1),cells(cells(65536).end(xlup).row, 1)) if c=c.offset(,1)then c=c.offset(,2) next End Sub Sub Chck2() for each c in range("a1:a"&range("a65536").end(xlup).row) if c=c.offset(,1)then c=c.offset(,2) next End Sub As I see this Sub compares Values in Columns for same Row, but if cell will be in another row the Sub will not find any match. It may work for RED RED R BLUE BLUE B But not for RED BLUE B BLUE RED R |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I guess I do NOT understand your problem.
"SolaSig AB" wrote in message ... Dear Don, Thanks but I actually didn't understand how to make this Sub. I have combined all your post and got following subs. But this don't work :( Here are two Subs, but I don't know what is wrong: Sub Chck() for each c in range(cells(1,1),cells(cells(65536).end(xlup).row, 1)) if c=c.offset(,1)then c=c.offset(,2) next End Sub Sub Chck2() for each c in range("a1:a"&range("a65536").end(xlup).row) if c=c.offset(,1)then c=c.offset(,2) next End Sub As I see this Sub compares Values in Columns for same Row, but if cell will be in another row the Sub will not find any match. It may work for RED RED R BLUE BLUE B But not for RED BLUE B BLUE RED R |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HowTo: Baseball Calculator? | Excel Discussion (Misc queries) | |||
HOWTO DELETE UNLOCK CELLS | Excel Discussion (Misc queries) | |||
howto: concat (x1:x3) | New Users to Excel | |||
HowTo add row to series data | Charts and Charting in Excel | |||
HOWTO Replace from Row | Excel Programming |