ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to paste data in alternate cells-pawan (https://www.excelbanter.com/excel-programming/332265-macro-paste-data-alternate-cells-pawan.html)

Pawan

macro to paste data in alternate cells-pawan
 
i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan

Patrick Molloy[_2_]

macro to paste data in alternate cells-pawan
 
so for ILB3, where would that go? you explanation would indicate 3 and 5 but
that would over-write PWV3.

"Pawan" wrote:

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


Pawan

macro to paste data in alternate cells-pawan
 
Oh..Pratick....
Unknowingly I wrote in wrong way...
corrected question is here...

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 4 and 6 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan



"Patrick Molloy" wrote:

so for ILB3, where would that go? you explanation would indicate 3 and 5 but
that would over-write PWV3.

"Pawan" wrote:

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


Patrick Molloy[_2_]

macro to paste data in alternate cells-pawan
 
Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)

rw=rw+1
LOOP
End Sub

"Pawan" wrote:

Oh..Pratick....
Unknowingly I wrote in wrong way...
corrected question is here...

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 4 and 6 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan



"Patrick Molloy" wrote:

so for ILB3, where would that go? you explanation would indicate 3 and 5 but
that would over-write PWV3.

"Pawan" wrote:

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


Pawan

macro to paste data in alternate cells-pawan
 
I am not able to do this. It is giving run time error : 1004-Applicatio
defined or object defined error. Can u pls help me?
-Pawan

"Patrick Molloy" wrote:

Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)

rw=rw+1
LOOP
End Sub

"Pawan" wrote:

Oh..Pratick....
Unknowingly I wrote in wrong way...
corrected question is here...

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 4 and 6 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan



"Patrick Molloy" wrote:

so for ILB3, where would that go? you explanation would indicate 3 and 5 but
that would over-write PWV3.

"Pawan" wrote:

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


Dave Peterson[_5_]

macro to paste data in alternate cells-pawan
 
I think Patrick forgot to initialize rw.

Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
rw = 1 '<-- Added
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)
rw=rw+1
LOOP
End Sub



Pawan wrote:

I am not able to do this. It is giving run time error : 1004-Applicatio
defined or object defined error. Can u pls help me?
-Pawan

"Patrick Molloy" wrote:

Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)

rw=rw+1
LOOP
End Sub

"Pawan" wrote:

Oh..Pratick....
Unknowingly I wrote in wrong way...
corrected question is here...

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 4 and 6 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


"Patrick Molloy" wrote:

so for ILB3, where would that go? you explanation would indicate 3 and 5 but
that would over-write PWV3.

"Pawan" wrote:

i want to paste data in alternate cells. e.g. i have following 2 columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


--

Dave Peterson

Patrick Molloy

macro to paste data in alternate cells-pawan
 
oops !

thanks Dave

"Dave Peterson" wrote in message
...
I think Patrick forgot to initialize rw.

Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
rw = 1 '<-- Added
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)
rw=rw+1
LOOP
End Sub



Pawan wrote:

I am not able to do this. It is giving run time error : 1004-Applicatio
defined or object defined error. Can u pls help me?
-Pawan

"Patrick Molloy" wrote:

Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)

rw=rw+1
LOOP
End Sub

"Pawan" wrote:

Oh..Pratick....
Unknowingly I wrote in wrong way...
corrected question is here...

i want to paste data in alternate cells. e.g. i have following 2
columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to
paste ILA3
in row 4 and 6 of column B...and so on....it is tedious to do it
for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


"Patrick Molloy" wrote:

so for ILB3, where would that go? you explanation would indicate 3
and 5 but
that would over-write PWV3.

"Pawan" wrote:

i want to paste data in alternate cells. e.g. i have following 2
columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to
paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it
for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


--

Dave Peterson




Dave Peterson[_5_]

macro to paste data in alternate cells-pawan
 
You are welcome, Sir!

Patrick Molloy wrote:

oops !

thanks Dave

"Dave Peterson" wrote in message
...
I think Patrick forgot to initialize rw.

Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
rw = 1 '<-- Added
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)
rw=rw+1
LOOP
End Sub



Pawan wrote:

I am not able to do this. It is giving run time error : 1004-Applicatio
defined or object defined error. Can u pls help me?
-Pawan

"Patrick Molloy" wrote:

Sub Main()
DIM Index as Long
DIM rw as Long
index = 1
DO Until Cells(rw,1) = ""
index =index +1
Cells(index,2) = Cells(rw,1)
index = index + 2
Cells(index,2) = Cells(rw,1)

rw=rw+1
LOOP
End Sub

"Pawan" wrote:

Oh..Pratick....
Unknowingly I wrote in wrong way...
corrected question is here...

i want to paste data in alternate cells. e.g. i have following 2
columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to
paste ILA3
in row 4 and 6 of column B...and so on....it is tedious to do it
for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


"Patrick Molloy" wrote:

so for ILB3, where would that go? you explanation would indicate 3
and 5 but
that would over-write PWV3.

"Pawan" wrote:

i want to paste data in alternate cells. e.g. i have following 2
columns:
A B
PWV3 DIGOUTHG
ILA3 DIGOUTHG
ILB3 DIGOUTHG
PDE3 DIGOUTHG
ILC3 DIGOUTHG
QWR3 DIGOUTHG
PWV4 DIGOUTHG
ILA4 DIGOUTHG

I want to paste PWV3 in row 1 and 3 of column B. Then I want to
paste ILA3
in row 2 and 4 of column B...and so on....it is tedious to do it
for large
numner of rows. Can we write macro for this...

thank you...

-Pawan


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 05:41 PM.

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