Thread: Code Question
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Code Question

Without knowing what your sheet looks like

if isempty(Range("K" & myRow)) then
Range("K" & myRow).Value = myRange.Cells(i,j).Value
Range("L" & myRow).Resize(1,7).ClearContents
else
Range("IV" & myRow).End(xlToLeft)(1, 2).Value = _
myRange.Cells(i, j).Value
End if

this should work if it was going farther to the left than column K.

--
Regards,
Tom Ogilvy


"Michael168 " wrote in message
...
Hi Norman Jones,

The code don't work right. It start at col "K" but stop writing the
other values to the other columns.

Range("IV" & myRow).End(xlToLeft)(1, 2).Value = _
myRange.Cells(i, j).Value

The above code is working except it always start next to empty cell.
What I want how to specify it to start in col "K". The rest remain
unchange.

I even change the code to

Range("K" & myRow).End(xlToLeft)(1, 2).Value = _
myRange.Cells(i, j).Value

This also don't work. It still start next to the first empty cell. I
actually need it to write in the values from Col "K" to Col "R".

Regards,
Michael


---
Message posted from http://www.ExcelForum.com/