Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Data Entry Form

Hi ,
My knowledge about excel programming is very limited. I have a
sheet with months in the first row. The first column contains names of
Products. The intervening grid contains the sales of these items for
these months.

A B C D E
1 APR MAY JUNE JULY
2 PRODUCT 1
3 PRODUCT 2
4 PRODUCT 3
5 PRODUCT 4

My userform has comboboxes "cboMonth" and "cboProduct".A text
box "txtSales".I would like to enter data into the sheet depending
on the selections of the two comboboxes.Example: if
cboMonth.Value="MAY" AND cboProduct.Value ="PRODUCT 3" then the
data from txtSales should get copied to the cell "C4".
I am unable to link these using code.My sheet is very long with many
products(and therefore many Rows).Hence a data entry form is very much
useful .
Please help.

P.Jaimal

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Data Entry Form

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Dim myCol As Variant
Dim myRow As Variant

With Worksheets("sheet1") 'whereever this table is.
myCol = Application.Match(cboMonth.Value, .Rows(1), 0)
myRow = Application.Match(cboProduct.Value, .Columns(1), 0)
If IsNumeric(myCol) _
And IsNumeric(myRow) Then
.Range("a1").Cells(myRow, myCol).Value = txtSales.Value
Else
Beep
MsgBox "oopsie"
End If
End With

End Sub

You've posted this to several newsgroups. You may want to post response to
those inquiries that you have an answer or at least an active thread in
..programming.

It'll make less work for others--or may get you improved answers here.


"P.Jaimal" wrote:

Hi ,
My knowledge about excel programming is very limited. I have a
sheet with months in the first row. The first column contains names of
Products. The intervening grid contains the sales of these items for
these months.

A B C D E
1 APR MAY JUNE JULY
2 PRODUCT 1
3 PRODUCT 2
4 PRODUCT 3
5 PRODUCT 4

My userform has comboboxes "cboMonth" and "cboProduct".A text
box "txtSales".I would like to enter data into the sheet depending
on the selections of the two comboboxes.Example: if
cboMonth.Value="MAY" AND cboProduct.Value ="PRODUCT 3" then the
data from txtSales should get copied to the cell "C4".
I am unable to link these using code.My sheet is very long with many
products(and therefore many Rows).Hence a data entry form is very much
useful .
Please help.

P.Jaimal


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Data Entry Form

Thanks a lot Dave.The code works very well.I am sorry for the multiple
posts.I think that there was a problem somewhere the day I was posting
the message.I was not getting the confirmation that my message was
accepted.Hence the multiple posts.Thanks once again.

P.Jaimal

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
Form for data entry Lin Light Excel Discussion (Misc queries) 2 October 9th 07 06:01 PM
Data Entry form P.Jaimal Excel Programming 0 November 26th 05 05:32 PM
Data Entry Form (similar to default Excel DataForm) tonydm Excel Programming 0 October 11th 05 07:59 PM
data entry form Tess Excel Discussion (Misc queries) 0 March 2nd 05 03:43 PM
Data Entry on a Form Chrissy[_4_] Excel Programming 5 July 20th 03 05:12 AM


All times are GMT +1. The time now is 06:55 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"