Loop code problems

P

pauluk

Hi, i am using the following code to place the letters EA in column
for some reason it places it in colum n o p q r s? Can so one help

the code am using is

set myrange = Application.Selection
for each cell in myrange
cell.offset(0,13).Value="EA"
Nex
 
F

Frank Kabel

Hi
depends on your selection as you use offset for this. try
replacing the line
cell.offset(0,13).Value="EA"

with
cells(cell.row,"N").value = "EA"
 
M

Melanie Breden

Hi, i am using the following code to place the letters EA in column N
for some reason it places it in colum n o p q r s? Can so one help

the code am using is

set myrange = Application.Selection
for each cell in myrange
cell.offset(0,13).Value="EA"
Next

for example:
Cells(cell.Row, "N").Value = "EA"

or:
cell.Offset(0, 13 - cell.Column).Value = "EA"


--
Regards

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)
 
Top