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: 20
Default How to interpret my code

I have been given some code that should worl to get information from five
standardised docs till a new similar doc. However, as the code given is not
perfectly fitted to my doc I have trouble in getting the code work for me.
The code is (this is not all data for the process but only the data that does
not work:

private Sub GetData(LsWorkbook As String)

Dim LrDestRange As Range
Dim LrSourceRange As Range
Dim LlCounter As Long
Dim LwkbkSource As Workbook
Dim LrRange As Range
Dim LsFileFolder As String






' First Check that the format of the data is correct

With LwkbkSource.Sheets(1)
Set LrSourceRange = .Range(.Range("A1"), .Range("A1").End(xlToRight))
End With

For Each LrRange In SData.Range("Headings")

If LrRange.Offset(-1, 0).Value = "Check" Then

If Not LrSourceRange.Cells(LrRange.Column).Value = LrRange.Value Then

MsgBox "Source data is missing column " & LrRange.Column & ", value
= " & LrRange.Value

End

End If

End If

Next

' Passed the checks so paste in the data

Set LrDestRange = SData.Range("A1").End(xlDown).Offset(1, 0)

With LwkbkSource.Sheets(1)
Set LrSourceRange = .Range(.Range("A2"),
..Range("A2").End(xlDown).Offset(0, SData.Range("Headings").Columns.Count))
End With

LrDestRange.Resize(LrSourceRange.Rows.Count,
LrSourceRange.Columns.Count).Value = LrSourceRange.Value

LrDestRange.Offset(0, LrSourceRange.Columns.Count -
1).Resize(LrSourceRange.Rows.Count, 1).Value = LsWorkbook

LwkbkSource.Close

Exit Sub


So what I want to be able to do is to get my five tabs with information,
A,B,C,D,E to get copied and pasted in the new document below eachother. The
new document is called X. The thing is that the array I want to copy is from
c6:O6 and all the way down until the last row which can fluctuate. So as I
see it the code must be changed for that as well...

What other things must I do to get it to work??? for example

With LwkbkSource.Sheets(1)

what does that mean, must I change Sheets(1) for something???

I would like to keep as close to the original codeas possible, but could
anyone see and tell me what changes I need to do????
 
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
Determine and interpret the P-Value roystonteo via OfficeKB.com Excel Discussion (Misc queries) 2 February 6th 09 05:34 AM
How does VBA interpret Dates? Greg Glynn Excel Programming 2 July 10th 07 03:28 AM
Interpret code FIRSTROUNDKO via OfficeKB.com Excel Programming 4 March 22nd 06 06:21 PM
Why does Excel interpret 2/29 as Feb 1st? Jo Excel Discussion (Misc queries) 6 February 26th 05 06:06 PM
Could some one please help me to interpret the following syntax Augustus Excel Programming 5 March 3rd 04 09:55 AM


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