Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default What's wrong with this code, please?

I have 4 columns with data in them. I first check to see if two cells match.
If so, I want to fill in the value of a cell in a third column with the
corresponding value from a 4th Column. Nothing happens...

For i = 5 To numberofRows
If Cells(i, 111).Value = Cells(12, j).Value Then
Cells(k, j).Value = Cells(i, 112).Value
k = k + 1
End If
Next

Help would be appreciated. BTW, thanks to those who have assisted in
previous requests.

Jim Berglund


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default What's wrong with this code, please?

Cells(i,111).Value never equals Cells(12,j)

j never gets initialized and you are using On Error Resume Next, so you
never see the error

k is never initialized and you are using On Error Resume Next, so you never
see the error.

Just some possibilities.

--
Regards,
Tom Ogilvy

"Jim Berglund" wrote in message
...
I have 4 columns with data in them. I first check to see if two cells

match.
If so, I want to fill in the value of a cell in a third column with the
corresponding value from a 4th Column. Nothing happens...

For i = 5 To numberofRows
If Cells(i, 111).Value = Cells(12, j).Value Then
Cells(k, j).Value = Cells(i, 112).Value
k = k + 1
End If
Next

Help would be appreciated. BTW, thanks to those who have assisted in
previous requests.

Jim Berglund




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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with this code? Ayo Excel Discussion (Misc queries) 14 June 10th 08 03:09 AM
What is wrong with this code? jlclyde Excel Discussion (Misc queries) 5 January 9th 08 05:12 PM
What's wrong w/my code? nrage21[_54_] Excel Programming 5 July 28th 04 03:50 PM
Can someone tell me what's wrong with this code please? malycom Excel Programming 4 June 3rd 04 03:26 PM
What is wrong with this code? Matt Excel Programming 0 January 22nd 04 08:11 PM


All times are GMT +1. The time now is 01:33 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"