Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Another question

i have two sheets in which one is blank

using vba code i want to copy column one three seven and paste them into another sheet

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Another question

On Tuesday, September 11, 2012 11:26:10 AM UTC-4, TIMOTHY wrote:
i have two sheets in which one is blank



using vba code i want to copy column one three seven and paste them into another sheet


Try this (you may need to change sheet names as applicable)

Sub CopyColumns()
Sheets("Sheet1").Range("A:A,C:C,G:G").Copy _
Sheets("Sheet2").Range("A1")
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Another question

On Sep 12, 7:05*am, wrote:
On Tuesday, September 11, 2012 11:26:10 AM UTC-4, TIMOTHY wrote:
i have two sheets in which one is blank


using vba code i want to copy column one three seven and paste them into another sheet


Try this (you may need to change sheet names as applicable)

Sub CopyColumns()
Sheets("Sheet1").Range("A:A,C:C,G:G").Copy _
* * Sheets("Sheet2").Range("A1")
End Sub


suppose column headings of that three are suppliername, contact, and
emailid. And if i dont know the column no. In that case?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Another question

On Sep 12, 7:05*am, wrote:
On Tuesday, September 11, 2012 11:26:10 AM UTC-4, TIMOTHY wrote:
i have two sheets in which one is blank


using vba code i want to copy column one three seven and paste them into another sheet


Try this (you may need to change sheet names as applicable)

Sub CopyColumns()
Sheets("Sheet1").Range("A:A,C:C,G:G").Copy _
* * Sheets("Sheet2").Range("A1")
End Sub


suppose column headings of that three are suppliername, contact, and
emailid. And if i dont know the column no. In that case?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Another question

On Sep 12, 7:05*am, wrote:
On Tuesday, September 11, 2012 11:26:10 AM UTC-4, TIMOTHY wrote:
i have two sheets in which one is blank


using vba code i want to copy column one three seven and paste them into another sheet


Try this (you may need to change sheet names as applicable)

Sub CopyColumns()
Sheets("Sheet1").Range("A:A,C:C,G:G").Copy _
* * Sheets("Sheet2").Range("A1")
End Sub


suppose column headings of that three are suppliername, contact, and
emailid. And if i dont know the column no. In that case?


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Another question

suppose column headings of that three are suppliername, contact, and

emailid. And if i dont know the column no. In that case?


Try:

Sub FindandCopy()
Dim x As Long
Dim sFind(1 To 3) As String
Dim sFound As String

'Update values below as necessary
sFind(1) = "suppliername"
sFind(2) = "contact"
sFind(3) = "emailid"

On Error Resume Next
For x = 1 To 3
'Change "Rows("1:1")" to whatever range includes your column headings
sFound = sFound & Rows("1:1").Find(What:=sFind(x), After:=Cells(1, 1), LookIn:= _
xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).EntireColumn.Address & ","
Next x
On Error GoTo 0

If Len(sFound) 1 Then
sFound = Left(sFound, Len(sFound) - 1)
Sheets("Sheet1").Range(sFound).Copy _
Sheets("Sheet2").Range("A1")
End If
End Sub
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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


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

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

About Us

"It's about Microsoft Excel"