LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
len len is offline
external usenet poster
 
Posts: 53
Default Move Data From Active Sheet to New WorkBook

This is only the third time in my life I have used Excel.

I am sure it is going to be a learning curve.

I have a huge SpreadSheet I need to reduce to a workable document. I had it
working between Active Sheeets but kept losing data.

I now realize that I must copy the selected information to a new Workbook,
but I am having trouble learning the proper code.

Here is my code so far, I have been working on it for two days so it may not
look very good!

Sub ClassAAA()

Dim lastRow As Long
Dim WB As Workbook
Dim NB As Workbook
Dim ws As Worksheet
Dim SelCol As String

' Selection.AutoFilter Field:=12, Criteria1:="AAA"
SelCol = InputBox("Enter The Column for the Coach You Want to Send
Letters To:!")
Set WB = Workbooks.Add
With WB
.Title = "Letters to Parents"
.Subject = "Grades"
.SaveAs Filename:="TxLabels.xls"
End With
' Workbooks.Open ("TxLabels.xls")
Set WB = ActiveWorkbook
Set NB = ActiveWorkbook
Set wk = ActiveSheet
' Set ws = Workbooks.Add(after:=Worksheets(Worksheets.Count))
WB.Columns(SelCol).Copy NB.Columns(1) ' ? Here is my problem at
this point
wk.Columns(3).Copy ws.Columns(2)
wk.Columns(5).Copy ws.Columns(3)
wk.Columns(7).Copy ws.Columns(4)
wk.Columns(8).Copy ws.Columns(5)
wk.Columns(9).Copy ws.Columns(6)

' ActiveCell.FormulaR1C1 = ""
' ChDir "C:\ExcelExp"

ActiveWorkbook.SaveAs Filename:="C:\ExcelExp\TxLabels.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

MsgBox "Class AAA Completed"

End Sub

I just cannot find examples of the objects I need to learn.

Thanks for any help

Len


 
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
Move Active Workbook to another Folder jonallen51 Excel Discussion (Misc queries) 0 March 12th 08 07:41 PM
Save active sheet into new workbook MarkN Excel Programming 3 August 22nd 07 09:00 PM
Consolidation of data from cell in active sheet of closed workbook Neil X Peel Excel Worksheet Functions 3 March 8th 07 02:35 PM
Move Active Cell after Data Validation List [email protected] Excel Programming 3 May 30th 06 03:15 PM
Reliably get sheet 1 of the active workbook Michael D. Ober Excel Programming 6 October 27th 03 07:48 PM


All times are GMT +1. The time now is 01:54 AM.

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

About Us

"It's about Microsoft Excel"