?
Solved

read row from excel

Posted on 2011-10-03
5
Medium Priority
?
219 Views
Last Modified: 2012-05-12
how can i (see code):

* output a certain total row on a certain sheet to textbox1
* past a certain total row on a certain sheet to another Excel object?
Dim newExcel As Excel.Application = New Excel.Application
Dim orgExcel As Excel.Application = New Excel.Application

Dim orgWorkBook = orgExcel.Workbooks.Open(sMyFile)
Dim orgWorkSheet = orgWorkBook.Worksheets(My.Settings.vWorkSheetOrg)
orgWorkSheet.Activate()

Open in new window

0
Comment
Question by:Ollie90
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:viralypatel
ID: 36902895
Sub PasteRowDelete()
' Macro recorded 10/29/2001 by Thomas Urtis
Application.ScreenUpdating = False
Worksheets("Illinois").Select
ActiveCell.EntireRow.Select
Selection.Cut
Sheets("Deleted Prospects").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Illinois").Select
Selection.Delete Shift:=xlUp
ActiveCell.Select
Application.ScreenUpdating = True
End Sub

Open in new window

0
 
LVL 12

Expert Comment

by:viralypatel
ID: 36902899
0
 

Author Comment

by:Ollie90
ID: 36903264
i doesn't work:

error : Select method of Range class failed

Dim orgWorkBook = orgExcel.Workbooks.Open(sMyFile)
Dim orgWorkSheet = orgWorkBook.Worksheets(My.Settings.vWorkSheetOrg)
orgWorkSheet.Activate()
orgWorkSheet.Rows("3:3").Select()
0
 

Author Comment

by:Ollie90
ID: 36903477
is it possible that this gives an error because the sheet is hidden?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 36906479
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Loops Section Overview
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question