Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default view data into userform

hi
i have fileds like date,party_name,Item,Qty,rate,amt
where i use advance filter to filter requ. data & copy paste into new sheet.
useing code.

Sub Job()

Sheets("data").Select

Range("A4:F5000").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"A1:F2"), CopyToRange:=Range("BA4"), Unique:=False

Range("BA4").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Report").Select
Range("A1").Select
ActiveSheet.Paste

Range("A4").Select

End Sub
IT works fine. But what i want is there can i put filter data into userform
and view them useing next and pervious button. where in user form we can not
make any change.
is any one will help me.

Thanks
Regards

****al shah.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default view data into userform

At the top of a new general module

Public rng as Range
Public cell as Range
Public Idex as Long
Sub ShowForm
Sheets("data").Select
set rng = Range("BA4").CurrentRegion.Columns(1).Cells
if rng.count <= 1 then exit sub
set rng = rng.offset(1,0).Resize(rng.rows.count-1)
load Userform1
PopBoxes 1
Userform1.Show
End Sub

Public Function PopBoxes(iidex)
On Error goto ErrHandler
set cell = rng(iidex)
idex = iidex
with userform1
.Textbox1.Text = cell.Text
.Textbox2.Text = cell.Offset(0,1).Text
.Textbox3.Text = cell.Offset(0,2).Text
.Textbox4.Text = cell.Offset(0,3).Text
End With
PopBoxes = True
Exit Function
errHandler:
PopBoxes = False
End Function

in the userform module

Private CmdForward_Click()
if idex = rng.count then
exit sub
Else
PopBoxes idex + 1
End if
End Sub

Private CmdBackward_Click()
if idex = 1 then
exit sub
Else
PopBoxes idex - 1
End if
End Sub

Private CmdExit()
unload Userform1
End Sub

Create a userform1 with 4 textboxes name Textbox1 to 4
add 3 commandbutton. Name thenm
CmdForward (Caption Forward)
CmdBackward (Caption Backward)
CmdExit (Caption Exit)


Add or remove textboxes to fit your data.
You can embellish the form with more functionality

Code is untested and may contain typos.
--
Regards,
Tom Ogilvy





"****al shah" wrote in message
...
hi
i have fileds like date,party_name,Item,Qty,rate,amt
where i use advance filter to filter requ. data & copy paste into new

sheet.
useing code.

Sub Job()

Sheets("data").Select

Range("A4:F5000").AdvancedFilter Action:=xlFilterCopy,

CriteriaRange:=Range( _
"A1:F2"), CopyToRange:=Range("BA4"), Unique:=False

Range("BA4").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Report").Select
Range("A1").Select
ActiveSheet.Paste

Range("A4").Select

End Sub
IT works fine. But what i want is there can i put filter data into

userform
and view them useing next and pervious button. where in user form we can

not
make any change.
is any one will help me.

Thanks
Regards

****al shah.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default view data into userform

Thanks Mr. Tom Ogilvy
It's working very Nice. But i want to ask one more thing, can we see only
selected filed. like there is "Rate Filed" in which i done want to inclued
in useform is this possible.

Rgards

****al

"Tom Ogilvy" wrote:

At the top of a new general module

Public rng as Range
Public cell as Range
Public Idex as Long
Sub ShowForm
Sheets("data").Select
set rng = Range("BA4").CurrentRegion.Columns(1).Cells
if rng.count <= 1 then exit sub
set rng = rng.offset(1,0).Resize(rng.rows.count-1)
load Userform1
PopBoxes 1
Userform1.Show
End Sub

Public Function PopBoxes(iidex)
On Error goto ErrHandler
set cell = rng(iidex)
idex = iidex
with userform1
.Textbox1.Text = cell.Text
.Textbox2.Text = cell.Offset(0,1).Text
.Textbox3.Text = cell.Offset(0,2).Text
.Textbox4.Text = cell.Offset(0,3).Text
End With
PopBoxes = True
Exit Function
errHandler:
PopBoxes = False
End Function

in the userform module

Private CmdForward_Click()
if idex = rng.count then
exit sub
Else
PopBoxes idex + 1
End if
End Sub

Private CmdBackward_Click()
if idex = 1 then
exit sub
Else
PopBoxes idex - 1
End if
End Sub

Private CmdExit()
unload Userform1
End Sub

Create a userform1 with 4 textboxes name Textbox1 to 4
add 3 commandbutton. Name thenm
CmdForward (Caption Forward)
CmdBackward (Caption Backward)
CmdExit (Caption Exit)


Add or remove textboxes to fit your data.
You can embellish the form with more functionality

Code is untested and may contain typos.
--
Regards,
Tom Ogilvy





"****al shah" wrote in message
...
hi
i have fileds like date,party_name,Item,Qty,rate,amt
where i use advance filter to filter requ. data & copy paste into new

sheet.
useing code.

Sub Job()

Sheets("data").Select

Range("A4:F5000").AdvancedFilter Action:=xlFilterCopy,

CriteriaRange:=Range( _
"A1:F2"), CopyToRange:=Range("BA4"), Unique:=False

Range("BA4").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Report").Select
Range("A1").Select
ActiveSheet.Paste

Range("A4").Select

End Sub
IT works fine. But what i want is there can i put filter data into

userform
and view them useing next and pervious button. where in user form we can

not
make any change.
is any one will help me.

Thanks
Regards

****al shah.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default view data into userform

You have absolute control over which fields you display and in what Order.

This is what I showed you as an example,
.Textbox1.Text = cell.Text
.Textbox2.Text = cell.Offset(0,1).Text
.Textbox3.Text = cell.Offset(0,2).Text
.Textbox4.Text = cell.Offset(0,3).Text

so this showed values in columna A, B, C, D. But if I wanted D, A, G, M

.Textbox1.Text = cell.Offset.(0,3).Text
.Textbox2.Text = cell.Offset(0,0).Text
.Textbox3.Text = cell.Offset(0,6).Text
.Textbox4.Text = cell.Offset(0,12).Text

so you use your code to indicate what goes where.

--
Regards,
Tom Ogilvy



"****al shah" wrote in message
...
Thanks Mr. Tom Ogilvy
It's working very Nice. But i want to ask one more thing, can we see only
selected filed. like there is "Rate Filed" in which i done want to

inclued
in useform is this possible.

Rgards

****al

"Tom Ogilvy" wrote:

At the top of a new general module

Public rng as Range
Public cell as Range
Public Idex as Long
Sub ShowForm
Sheets("data").Select
set rng = Range("BA4").CurrentRegion.Columns(1).Cells
if rng.count <= 1 then exit sub
set rng = rng.offset(1,0).Resize(rng.rows.count-1)
load Userform1
PopBoxes 1
Userform1.Show
End Sub

Public Function PopBoxes(iidex)
On Error goto ErrHandler
set cell = rng(iidex)
idex = iidex
with userform1
.Textbox1.Text = cell.Text
.Textbox2.Text = cell.Offset(0,1).Text
.Textbox3.Text = cell.Offset(0,2).Text
.Textbox4.Text = cell.Offset(0,3).Text
End With
PopBoxes = True
Exit Function
errHandler:
PopBoxes = False
End Function

in the userform module

Private CmdForward_Click()
if idex = rng.count then
exit sub
Else
PopBoxes idex + 1
End if
End Sub

Private CmdBackward_Click()
if idex = 1 then
exit sub
Else
PopBoxes idex - 1
End if
End Sub

Private CmdExit()
unload Userform1
End Sub

Create a userform1 with 4 textboxes name Textbox1 to 4
add 3 commandbutton. Name thenm
CmdForward (Caption Forward)
CmdBackward (Caption Backward)
CmdExit (Caption Exit)


Add or remove textboxes to fit your data.
You can embellish the form with more functionality

Code is untested and may contain typos.
--
Regards,
Tom Ogilvy





"****al shah" wrote in message
...
hi
i have fileds like date,party_name,Item,Qty,rate,amt
where i use advance filter to filter requ. data & copy paste into new

sheet.
useing code.

Sub Job()

Sheets("data").Select

Range("A4:F5000").AdvancedFilter Action:=xlFilterCopy,

CriteriaRange:=Range( _
"A1:F2"), CopyToRange:=Range("BA4"), Unique:=False

Range("BA4").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Report").Select
Range("A1").Select
ActiveSheet.Paste

Range("A4").Select

End Sub
IT works fine. But what i want is there can i put filter data into

userform
and view them useing next and pervious button. where in user form we

can
not
make any change.
is any one will help me.

Thanks
Regards

****al shah.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default view data into userform


thanks Mr. Tom Ogilvy
It's working.

****al

"Tom Ogilvy" wrote:

You have absolute control over which fields you display and in what Order.

This is what I showed you as an example,
.Textbox1.Text = cell.Text
.Textbox2.Text = cell.Offset(0,1).Text
.Textbox3.Text = cell.Offset(0,2).Text
.Textbox4.Text = cell.Offset(0,3).Text

so this showed values in columna A, B, C, D. But if I wanted D, A, G, M

.Textbox1.Text = cell.Offset.(0,3).Text
.Textbox2.Text = cell.Offset(0,0).Text
.Textbox3.Text = cell.Offset(0,6).Text
.Textbox4.Text = cell.Offset(0,12).Text

so you use your code to indicate what goes where.

--
Regards,
Tom Ogilvy



"****al shah" wrote in message
...
Thanks Mr. Tom Ogilvy
It's working very Nice. But i want to ask one more thing, can we see only
selected filed. like there is "Rate Filed" in which i done want to

inclued
in useform is this possible.

Rgards

****al

"Tom Ogilvy" wrote:

At the top of a new general module

Public rng as Range
Public cell as Range
Public Idex as Long
Sub ShowForm
Sheets("data").Select
set rng = Range("BA4").CurrentRegion.Columns(1).Cells
if rng.count <= 1 then exit sub
set rng = rng.offset(1,0).Resize(rng.rows.count-1)
load Userform1
PopBoxes 1
Userform1.Show
End Sub

Public Function PopBoxes(iidex)
On Error goto ErrHandler
set cell = rng(iidex)
idex = iidex
with userform1
.Textbox1.Text = cell.Text
.Textbox2.Text = cell.Offset(0,1).Text
.Textbox3.Text = cell.Offset(0,2).Text
.Textbox4.Text = cell.Offset(0,3).Text
End With
PopBoxes = True
Exit Function
errHandler:
PopBoxes = False
End Function

in the userform module

Private CmdForward_Click()
if idex = rng.count then
exit sub
Else
PopBoxes idex + 1
End if
End Sub

Private CmdBackward_Click()
if idex = 1 then
exit sub
Else
PopBoxes idex - 1
End if
End Sub

Private CmdExit()
unload Userform1
End Sub

Create a userform1 with 4 textboxes name Textbox1 to 4
add 3 commandbutton. Name thenm
CmdForward (Caption Forward)
CmdBackward (Caption Backward)
CmdExit (Caption Exit)


Add or remove textboxes to fit your data.
You can embellish the form with more functionality

Code is untested and may contain typos.
--
Regards,
Tom Ogilvy





"****al shah" wrote in message
...
hi
i have fileds like date,party_name,Item,Qty,rate,amt
where i use advance filter to filter requ. data & copy paste into new
sheet.
useing code.

Sub Job()

Sheets("data").Select

Range("A4:F5000").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Range( _
"A1:F2"), CopyToRange:=Range("BA4"), Unique:=False

Range("BA4").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Report").Select
Range("A1").Select
ActiveSheet.Paste

Range("A4").Select

End Sub
IT works fine. But what i want is there can i put filter data into
userform
and view them useing next and pervious button. where in user form we

can
not
make any change.
is any one will help me.

Thanks
Regards

****al shah.







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
Excel - data autofilter, then data sort how do you view all Peg Excel Discussion (Misc queries) 2 April 23rd 08 11:11 PM
View only UserForm? Claud Balls Excel Programming 4 January 5th 05 05:13 AM
MS Month View Control for use in XL Userform hglamy[_3_] Excel Programming 0 January 16th 04 03:01 PM
View the data in a cell on a userform Henry[_5_] Excel Programming 0 January 8th 04 11:53 PM
View Row Data in UserForm / Edit Pete T[_2_] Excel Programming 1 October 17th 03 10:36 PM


All times are GMT +1. The time now is 12:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"