ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Download for external data (https://www.excelbanter.com/excel-programming/306254-download-external-data.html)

Marie

Download for external data
 
I have used the following code to download from an AS400 and it works fine.
I copied it into another file and for some reason it is still downloading but
instead of putting the information from the different employees on top of
each other (row on top of row) it is putting it across the spreadsheet in
numerous columns. I am thinking it has something to do with the
'newpastelocation' but I can't figure out what.

Does anybody know?

Dim Employee As String
Dim EmployeeImport As String

Application.ScreenUpdating = False
Application.Worksheets("ACAPSCBS").Activate

Range("ACAPSCBSNoteList").EntireRow.Delete
Range("a1").EntireRow.Delete
Application.Range("ACAPSCBS!A1").Name = "NewPasteLocation2"

' For Each cell In Range("historical!a41:Historical!a41")
' Employee = Range("HISTORICAL!A4").Text
For Each Cell In Range("Employee!F2:Employee!F19")
If Cell.Offset(0, 1) = Range("historical!b4").Value Then

Bank = Cell.Value

Application.Worksheets("ACAPSCBS").Activate
Range("a65536").Select
Selection.End(xlUp).Activate
ActiveCell.Offset(1, 0).Activate
Application.ActiveCell.Name = "NewPasteLocation2"



All times are GMT +1. The time now is 07:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com