Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Moving colC to colA

I want to move colC to ColA. I also want colA to not be destroyed. This is
what I'm doing so far. Thanks in advance.


Set objRange = objWorksheet.Range("C1").EntireColumn
objRange.Copy

Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate

Set objRange = objWorksheet.Range("A1")
objWorksheet.Paste (objRange)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Moving colC to colA

Mike, this is straight from the macro recorder:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/13/2007 by cchickering
'

'
Columns("C:C").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
End Sub

And this is the same code cleaned up:
Sub Macro1()
Columns("C:C").Cut
Columns("A:A").Insert Shift:=xlToRight
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"Mike" wrote:

I want to move colC to ColA. I also want colA to not be destroyed. This is
what I'm doing so far. Thanks in advance.


Set objRange = objWorksheet.Range("C1").EntireColumn
objRange.Copy

Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate

Set objRange = objWorksheet.Range("A1")
objWorksheet.Paste (objRange)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Moving colC to colA

How would you wirte that in VBScript?

"Charles Chickering" wrote:

Mike, this is straight from the macro recorder:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/13/2007 by cchickering
'

'
Columns("C:C").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
End Sub

And this is the same code cleaned up:
Sub Macro1()
Columns("C:C").Cut
Columns("A:A").Insert Shift:=xlToRight
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"Mike" wrote:

I want to move colC to ColA. I also want colA to not be destroyed. This is
what I'm doing so far. Thanks in advance.


Set objRange = objWorksheet.Range("C1").EntireColumn
objRange.Copy

Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate

Set objRange = objWorksheet.Range("A1")
objWorksheet.Paste (objRange)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Moving colC to colA

Sub MoveC()
Dim eApp As Object
Dim WB As Object
Dim r As Object
Set eApp = CreateObject(Excel.Application)
Set WB = eApp.Workbooks.Add
WB.Worksheets(1).Columns("C:C").Cut
WB.Worksheets(1).Columns("A:A").Insert Shift:=xlToRight
End Sub

Something along those lines should get a scripting file to work. I'm not
sure exactly what the rest of your code looks like though.
--
Charles Chickering

"A good example is twice the value of good advice."


"Mike" wrote:

How would you wirte that in VBScript?

"Charles Chickering" wrote:

Mike, this is straight from the macro recorder:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/13/2007 by cchickering
'

'
Columns("C:C").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
End Sub

And this is the same code cleaned up:
Sub Macro1()
Columns("C:C").Cut
Columns("A:A").Insert Shift:=xlToRight
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"Mike" wrote:

I want to move colC to ColA. I also want colA to not be destroyed. This is
what I'm doing so far. Thanks in advance.


Set objRange = objWorksheet.Range("C1").EntireColumn
objRange.Copy

Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate

Set objRange = objWorksheet.Range("A1")
objWorksheet.Paste (objRange)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Moving colC to colA

Ok that works fine.

"Charles Chickering" wrote:

Sub MoveC()
Dim eApp As Object
Dim WB As Object
Dim r As Object
Set eApp = CreateObject(Excel.Application)
Set WB = eApp.Workbooks.Add
WB.Worksheets(1).Columns("C:C").Cut
WB.Worksheets(1).Columns("A:A").Insert Shift:=xlToRight
End Sub

Something along those lines should get a scripting file to work. I'm not
sure exactly what the rest of your code looks like though.
--
Charles Chickering

"A good example is twice the value of good advice."


"Mike" wrote:

How would you wirte that in VBScript?

"Charles Chickering" wrote:

Mike, this is straight from the macro recorder:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 2/13/2007 by cchickering
'

'
Columns("C:C").Select
Selection.Cut
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
End Sub

And this is the same code cleaned up:
Sub Macro1()
Columns("C:C").Cut
Columns("A:A").Insert Shift:=xlToRight
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"Mike" wrote:

I want to move colC to ColA. I also want colA to not be destroyed. This is
what I'm doing so far. Thanks in advance.


Set objRange = objWorksheet.Range("C1").EntireColumn
objRange.Copy

Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Activate

Set objRange = objWorksheet.Range("A1")
objWorksheet.Paste (objRange)

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
Count # items in ColA if blank in ColB Nadine Excel Worksheet Functions 11 March 29th 10 07:40 PM
adding a percentage for COLA to Payroll worksheet luvkisn Excel Worksheet Functions 2 July 13th 09 11:33 PM
match colC to ColA, put row from ColB for 'answer' MatthewTap Excel Discussion (Misc queries) 4 October 14th 05 07:38 PM
want to count in two columns; countif (colA=x AND colB=y)? Heather Murch Excel Worksheet Functions 1 February 17th 05 03:47 PM
Lookup value in colA whos row matches row of index value in colB Gwen Frishkoff Excel Worksheet Functions 3 October 30th 04 09:07 PM


All times are GMT +1. The time now is 09:39 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"