Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Determine number of rows with data
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Simon, post: 6441150"] Hi I am using the macro below to pull some data from an external workbook. The 2 issues I need to sort are: 1. The number of rows in the external workbook can vary. How do I amend this code to pull all of the rows with data? 2. The number of rows in the autofill also may vary. How do I autofill only the number of rows required? i.e the number of rows in column A that contain data. 'Lookup Previous Month Sales Columns("K:K").Select Selection.NumberFormat = "General" Range("K4").Select Selection.FormulaArray = _ "=SUM(IF('C:\ABB\[SalesPreviousMonth.xls]Category by Customer - Excel Ex'!R6C10:R263C10=RC1,'C:\ABB\[SalesPreviousMonth.xls]Category by Customer - Excel Ex'!R6C14:R263C14,0))" Selection.AutoFill Destination:=Range("K4:K300"), Type:=xlFillDefault Range("K3").Select ActiveCell.FormulaR1C1 = "Previous Month" I am new to VBA so simple speak is appreciated. Many thanks Simon [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Determine number of rows with data
Top