ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   posting data from a form to a sheet depending on month (https://www.excelbanter.com/excel-programming/278021-posting-data-form-sheet-depending-month.html)

melchead

posting data from a form to a sheet depending on month
 
hi,

I would like to have the user fill in a form and submit this data to a
sheet with monthly columns. the user must only be able to post the data
to the current month. in other words if he fills in the form in
september then the data will be filled in the september column only.

please could someone help me with this. i am sure that it has something
to do with month()

thanks



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Tom Ogilvy

posting data from a form to a sheet depending on month
 
Use your code to place the data in the appropriate column.

You can get a number from

Month(date)

so for example, if I do month(date), I get 9 since the month is september.

If the month September on the sheet is in column 15, then I could do

col = Month(date) + 6

cells(3,col).Value = Textbox1.Text

as an example.

--
Regards,
Tom Ogilvy

"melchead" wrote in message
...
hi,

I would like to have the user fill in a form and submit this data to a
sheet with monthly columns. the user must only be able to post the data
to the current month. in other words if he fills in the form in
september then the data will be filled in the september column only.

please could someone help me with this. i am sure that it has something
to do with month()

thanks



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/




melchead[_2_]

posting data from a form to a sheet depending on month
 
Tom,

Thanks for the reply but I am not sure what and how to use the
month(date) as you describe. I have searched the internet forums for a
solution but I am still in the dark.

Is it correct to place month(9) as september?
Where do I put in the month() function?

could you do a small example for me please.

As I explained previously I have a form which the user must complete on
a monthly basis. if he changes any of the data in the current month
then it must be accepted, but if he opens the form again and the month
has changed to say October then he can only update data to the October
column.

I have attached the spreadsheet in question which will make it clear.
Thanks again
Andre

File Attached: http://www.exceltip.com/forum/attach...?postid=280197 (ref_alrev1.xls)

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Tom Ogilvy

posting data from a form to a sheet depending on month
 
These attachment links don't work in the Microsoft Newsgroup where most
people are reading your post.

I gave a code example. Perhaps that is not what you are doing.

there is a month function both in VBA and in Excel (worksheetfunction).

It returns a number equivalent to the month such that Jan is a 1 and
December is a 12.

Use that to find out what column to work with.

--
Regards,
Tom Ogilvy

melchead wrote in message
...
Tom,

Thanks for the reply but I am not sure what and how to use the
month(date) as you describe. I have searched the internet forums for a
solution but I am still in the dark.

Is it correct to place month(9) as september?
Where do I put in the month() function?

could you do a small example for me please.

As I explained previously I have a form which the user must complete on
a monthly basis. if he changes any of the data in the current month
then it must be accepted, but if he opens the form again and the month
has changed to say October then he can only update data to the October
column.

I have attached the spreadsheet in question which will make it clear.
Thanks again
Andre

File Attached: http://www.exceltip.com/forum/attach...?postid=280197

(ref_alrev1.xls)

------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com