LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default auto add column

Hi there,

i am hoping you can help.

i hav the following code (see below) which takes numbers from multiple
spreadsheets etc (and it works well) however i am trying to do 1 last thing
and that is as follows:

The number that is placed in cell (iRow, 6) i would like to have tallied at
the end of the script, so for instance if there are 70 numbers then i would
like to leave a space and have a tally appear just underneath it in Cell 'f'
Line 72. Is this easy to do?

Thanking you in advance

Scott


Sub SubGetMyData()
Application.ScreenUpdating = False

Dim objFSO As Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
Dim objSubfolder As Scripting.Folder
Dim objFile As Scripting.File
Dim iRow As Long

iRow = 3
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("e:\scott\Sotek\Invoices\")
For Each objFile In objFolder.Files
If objFile.Type = "Microsoft Excel Worksheet" Then
Workbooks.Open Filename:=objFolder.Path & "\" & objFile.Name
With ActiveWorkbook.Worksheets(1)
.Range("A13").Copy
Destination:=ThisWorkbook.Worksheets(1).Cells(iRow , 1)
.Range("A14").Copy
Destination:=ThisWorkbook.Worksheets(1).Cells(iRow , 2)
.Range("A15").Copy
Destination:=ThisWorkbook.Worksheets(1).Cells(iRow , 3)
.Range("F7").Copy
Destination:=ThisWorkbook.Worksheets(1).Cells(iRow , 4)
.Range("F8").Copy
Destination:=ThisWorkbook.Worksheets(1).Cells(iRow , 5)
ThisWorkbook.Worksheets(1).Cells(iRow, 6).Value =
..Range("f45").Value
End With
ActiveWorkbook.Close savechanges:=False
iRow = iRow + 1
End If
Next

Application.ScreenUpdating = True
End Sub


 
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
Auto fit row height for one column jolowe Excel Discussion (Misc queries) 3 September 14th 09 04:06 AM
How do I add a column of numbers (auto sum)?? tonysaw Excel Worksheet Functions 1 July 6th 09 08:52 PM
auto fit of column in EXCEL msp Excel Discussion (Misc queries) 1 March 16th 09 03:02 PM
How can I auto refresh a column that has an auto filter in place Pastal Excel Discussion (Misc queries) 1 December 18th 07 11:43 AM
Auto BOLD max value in a column gevans Excel Worksheet Functions 2 March 6th 06 08:34 PM


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