View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Excel VBA : Sheet selection

Hi
something like

'....
Dim wks as worksheet
set wks = activeworkbook.worksheets("special_sheet")
with wks
For Each myRecord In .Range("A1:A" & .Range("A" &
..Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells(1), _
Cells(.Row, Columns.Count).End(xlToLeft))
<<<processing : pos(cell) = myField.Text 'etc
Next Myfield
End With
Next MyRecord
next with


--
Regards
Frank Kabel
Frankfurt, Germany


Hi all,
I have a spreadsheet out of which (using a VBA macro) I extract data
into a comma-delimited text file. below is the main loop construct to
get each cell within each row.

For Each myRecord In Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells(1), _
Cells(.Row, Columns.Count).End(xlToLeft))
<<<processing : pos(cell) = myField.Text 'etc
Next Myfield
End With
Next MyRecord
The problem I am having is that the macro will work on the Active
(open) sheet when I need it to always use a certain sheet.
Is there a simple solution for that?

Another issue I am having is that there are column filters set up.
Sometimes the macro will not dump all opf the records (it would leave
out last 15 or so rows). I am wondering if there is a way to

"disable"
the filtering in the code of the macro (with the filter "on" the
results are intermittent, with all filters off the results are
consistent. The picture attached has an example snapshot of the

column
filter.
Thank in advance,
Vitali Baranov

Attachment filename: filters.jpg
Download attachment:
http://www.excelforum.com/attachment.php?postid=561920 ---
Message posted from http://www.ExcelForum.com/