Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old February 24th 20, 08:32 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 16
Default vba excel copy paste 1 column to 1 column

sample image
https://i.imgur.com/l32T2VM.jpg

code vba excel

Sub pasteoneonecolumn()
Dim lngRow As Long, objCOMAddin As COMAddIn
lngRow = 1
With ActiveSheet
For Each objCOMAddin In Application.COMAddIns
.Cells(lngRow, "E").Value = .Cells(lngRow, "A").Value
.Cells(lngRow, "F").Value = .Cells(lngRow, "B").Value
.Cells(lngRow, "G").Value = .Cells(lngRow, "C").Value
lngRow = lngRow + 1
Next objCOMAddin
End With
End Sub




for ask

why not all, only E1:E7
only up to 7 columns, how can I get all the columns?
anyone can help for vba excel that ?

  #2   Report Post  
Old February 24th 20, 12:41 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,182
Default vba excel copy paste 1 column to 1 column

sample image
https://i.imgur.com/l32T2VM.jpg

code vba excel

Sub pasteoneonecolumn()
Dim lngRow As Long, objCOMAddin As COMAddIn
lngRow = 1
With ActiveSheet
For Each objCOMAddin In Application.COMAddIns
.Cells(lngRow, "E").Value = .Cells(lngRow, "A").Value
.Cells(lngRow, "F").Value = .Cells(lngRow, "B").Value
.Cells(lngRow, "G").Value = .Cells(lngRow, "C").Value
lngRow = lngRow + 1
Next objCOMAddin
End With
End Sub




for ask

why not all, only E1:E7
only up to 7 columns, how can I get all the columns?
anyone can help for vba excel that ?


Your loop counter is the number of COMAddins, NOT the number of rows (A:C)
containing values. Ergo, the loop stops when it runs out of COMAddins!

Not sure what your logic is (if any at all) for looping the COMAddins
collection, or what that has to do with the values shown in your link. Please
explain better what it is EXACTLY that you are trying to accomplish!

Otherwise...

Sub CopyCols()
With ActiveSheet
.Cells(1, 1).Resize(.UsedRange.Rows.Count, 3).Copy .Cells(1, "E")
End With 'ActiveSheet
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #3   Report Post  
Old February 25th 20, 12:36 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 16
Default vba excel copy paste 1 column to 1 column

gs, thank you for answering,
I have tried the VBA code, but I need the same function as the VBA code
because I need colomn to colomn, one one goes to colomn. sample


if the code you give is like copying = E1: H11 and paste it into A1

what I want is the same as copying E1 to A1, E2 to A3, & F1 to b1, F2 to b2.
  #4   Report Post  
Old February 25th 20, 12:40 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 16
Default vba excel copy paste 1 column to 1 column

gs, thank you for answering,
I have tried the VBA code, but I need the same function as the VBA code
because I need colomn to colomn, one one goes to colomn. sample

Sub CopyCols()
With ActiveSheet
.Cells(1, 1).Resize(.UsedRange.Rows.Count, 3).Copy .Cells(1, "E")
End With 'ActiveSheet
End Sub

if the code you give is like copying = E1: H11 and paste it into A1


but what I want is the same as copying E1 to A1, E2 to A2, & F1 to b1, F2 to b2.
  #5   Report Post  
Old February 25th 20, 12:41 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 16
Default vba excel copy paste 1 column to 1 column

gs, thank you for answering,
I have tried the VBA code, but I need the same function as the VBA code
because I need colomn to colomn, one one goes to colomn. sample

Sub CopyCols()
With ActiveSheet
.Cells(1, 1).Resize(.UsedRange.Rows.Count, 3).Copy .Cells(1, "E")
End With 'ActiveSheet
End Sub

if the code you give is like copying = E1: H11 and paste it into A1


but what I want is the same as copying E1 to A1, E2 to A3, & F1 to b1, F2 to b2.


  #6   Report Post  
Old February 25th 20, 12:46 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 16
Default vba excel copy paste 1 column to 1 column

gs, thank you for answering,
I have tried the VBA code, but I need the same function as the VBA code
because I need colomn to colomn, one one goes to colomn. sample

Sub CopyCols()
With ActiveSheet
.Cells(1, 1).Resize(.UsedRange.Rows.Count, 3).Copy .Cells(1, "E")
End With 'ActiveSheet
End Sub

if the code you give is like copying = E1: H11 and paste it into A1


but what I want is the same as copying E1 to A1, E2 to A2, & F1 to b1, F2 to b2.

is there another solution for VBA?
  #7   Report Post  
Old February 25th 20, 03:03 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,182
Default vba excel copy paste 1 column to 1 column

Oh, you mean go the other way?

Sub CopyCols()
With ActiveSheet
.Cells(1, "E").Resize(.UsedRange.Rows.Count, 3).Copy .Cells(1, "A")
End With 'ActiveSheet
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #8   Report Post  
Old February 26th 20, 01:05 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 16
Default vba excel copy paste 1 column to 1 column

Gs can u try

I tried it and it's not like my VBA code function.

can it? try downloud file

https://www.sendspace.com/file/hhkf5h

addin setup
and try excel name comaddins
click on and check google sheet

try click vba me and try vba you try
and check whether the google sheet matches what is issued
  #9   Report Post  
Old February 28th 20, 12:44 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Feb 2020
Posts: 16
Default vba excel copy paste 1 column to 1 column

Gs im try code

Sub CopyCols()
With ActiveSheet
.Cells(1, "E").Resize(.UsedRange.Rows.Count, 3).Copy .Cells(1, "A")
End With 'ActiveSheet
End Sub

the results
https://i.imgur.com/8BHhONu.jpg


im try code

Sub pasteoneonecolumn()
Dim lngRow As Long, objCOMAddin As COMAddIn
lngRow = 1
With ActiveSheet
For Each objCOMAddin In Application.COMAddIns
.Cells(lngRow, "E").Value = .Cells(lngRow, "A").Value
.Cells(lngRow, "F").Value = .Cells(lngRow, "B").Value
.Cells(lngRow, "G").Value = .Cells(lngRow, "C").Value
lngRow = lngRow + 1
Next objCOMAddin
End With
End Sub

the results

https://i.imgur.com/EromfU4.jpg


Do you have a solution?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy/paste in the next column Nicawette Excel Programming 4 January 30th 10 04:03 AM
Why won't the copy/paste from PDF retain the row/column in excel? checkQ Excel Discussion (Misc queries) 4 September 2nd 08 04:33 PM
Copy column in Excel and paste horizontally in Word. Confused Excel Discussion (Misc queries) 6 March 7th 08 07:22 PM
Save column J only using copy/paste & temporary copy mikeburg[_85_] Excel Programming 2 June 7th 06 05:37 PM
Open file, Copy a column and paste this into a new Excel doc - Pl Harish Mohanbabu[_2_] Excel Programming 1 August 4th 05 01:58 PM


All times are GMT +1. The time now is 10:14 AM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright 2004-2021 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017