Loop code problems

  • Thread starter Thread starter pauluk
  • Start date Start date
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
 
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"
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top