Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Search Spreadsheet - Results in either listbox or new spreadsheet

Im having a little of a situation here. I have a spreadsheet that has
13 columns and alot of rows. I made a form that would sort the data as
needed. so i have 2 cbo's to help with the sort. As of right now i have
it as follows:

For i = 1 To Worksheets("By Store").Rows.Count
If Worksheets("By Store").Cells(i, column).Value = cboRefine
Then
m = m + 1
For z = 1 To 13
Var1 = Cells(i, z).Value
Sheets("Results").Activate
Worksheets("Results").Cells(m, z).Value = Var1
Sheets("By Store").Activate
Next
End If
Next

This way works perfect and how i need it, however when it activates the
pages the screen is a constant flicker due to the constant page switch.
My qustion is that i was wondering if there is a better way to go about
this routine. Is a listbox maybe a better way to go? if so i might need
some assistance with that because i tried that prior and i couldnt
figure out how to make the values go into individual columns. anyway if
anyone has a feedback please let me know. thankyou.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Search Spreadsheet - Results in either listbox or new spreadsheet

Don't activate the other sheet - there is no reason to. Also, there is not
reason to loop through all 65536 rows if you don't have data in them all.

For i = 1 To Worksheets("By Store").Cells(Rows.Count,column).End(xlup).row
If Worksheets("By Store").Cells(i, column).Value = cboRefine Then
m = m + 1
For z = 1 To 13
Var1 = Cells(i, z).Value
Worksheets("Results").Cells(m, z).Value = Var1
Next
End If
Next

--
Regards,
Tom Ogilvy


"Brandon Johnson" wrote:

Im having a little of a situation here. I have a spreadsheet that has
13 columns and alot of rows. I made a form that would sort the data as
needed. so i have 2 cbo's to help with the sort. As of right now i have
it as follows:

For i = 1 To Worksheets("By Store").Rows.Count
If Worksheets("By Store").Cells(i, column).Value = cboRefine
Then
m = m + 1
For z = 1 To 13
Var1 = Cells(i, z).Value
Sheets("Results").Activate
Worksheets("Results").Cells(m, z).Value = Var1
Sheets("By Store").Activate
Next
End If
Next

This way works perfect and how i need it, however when it activates the
pages the screen is a constant flicker due to the constant page switch.
My qustion is that i was wondering if there is a better way to go about
this routine. Is a listbox maybe a better way to go? if so i might need
some assistance with that because i tried that prior and i couldnt
figure out how to make the values go into individual columns. anyway if
anyone has a feedback please let me know. thankyou.


Reply
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
Removing a listbox from excel spreadsheet TrishB98 Excel Worksheet Functions 3 July 16th 08 07:57 PM
Copy Spreadsheet or listbox Brandon Johnson Excel Programming 0 June 6th 06 09:17 PM
How to get a listbox to move when scrolling down spreadsheet kdunnSBLI Excel Discussion (Misc queries) 1 June 24th 05 12:31 AM
Import Folder Search Results in a spreadsheet? Mark B Excel Discussion (Misc queries) 1 April 9th 05 05:17 PM
adding a listbox to a spreadsheet [email protected] Excel Programming 2 October 29th 03 05:45 PM


All times are GMT +1. The time now is 11:32 PM.

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"