ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loop code problems (https://www.excelbanter.com/excel-programming/296044-loop-code-problems.html)

pauluk[_51_]

Loop code problems
 
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

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


Frank Kabel

Loop code problems
 
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"

-----Original Message-----
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


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

.


Melanie Breden

Loop code problems
 
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)



All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com