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

Hi,

I am currently making a spreadsheet with a user form following the
guide on exceltip.com. I have creted the form and that works fine. But,
I have come to a problem.

What I want to do it when the user has filled the form in and it
inserts the data into the spreadsheets, i want the cell in column A, on
the row it has created with the new data, to have a number in it which
is consecutive to the number above it (123, 124, 125). How do I do
this?

Also, in one of the cells on the new row it has created is a formula
that is linked with another cell on that row, can you please tell me
if, as the rows of data go down the spreadsheet, the formula will
change itself to work on a new row. Can you tell me how to make it
work?

How do I get the current date displayed without the time showing, as
=now() displays the time as well as the date.

I think that is all,

thanks for any help,

humet


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel User Form problem


"humet" wrote in message
...
Hi,

I am currently making a spreadsheet with a user form following the
guide on exceltip.com. I have creted the form and that works fine. But,
I have come to a problem.

What I want to do it when the user has filled the form in and it
inserts the data into the spreadsheets, i want the cell in column A, on
the row it has created with the new data, to have a number in it which
is consecutive to the number above it (123, 124, 125). How do I do
this?


Cells(rw,1).Value = Cells(rw-1,1).Value + 1


Also, in one of the cells on the new row it has created is a formula
that is linked with another cell on that row, can you please tell me
if, as the rows of data go down the spreadsheet, the formula will
change itself to work on a new row. Can you tell me how to make it
work?


Cells(rw,2).Value = "=Sum(" & cells(rw,6).Resize(1,4).Address & ")"




How do I get the current date displayed without the time showing, as
=now() displays the time as well as the date.


Format the cell as mm/dd/yyyy
or use
=Today()


I think that is all,

thanks for any help,

humet

--
Regards,
Tom Ogilvy




---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel User Form problem

Where would I implement these lines of code into this:

------------------------------------------------------------------------------

Private Sub CommandButton1_Click()

ActiveWorkbook.Sheets("Datalist").Activate

Range("A1").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True

ActiveCell.Value =

ActiveCell.Offset(0, 1) = TextBox1.Value

ActiveCell.Offset(0, 2) = TextBox2.Value

ActiveCell.Offset(0, 3) = ComboBox1.Value

ActiveCell.Offset(0, 4) =

ActiveCell.Offset(0, 5) = "=TODAY()"

ActiveCell.Offset(0, 6) = "=YEAR(K13)"

ActiveCell.Offset(0, 7) = TextBox3.Value

ActiveCell.Offset(0, 8) = TextBox4.Value

Call CommandButton2_Click

Range("A1").Select

ActiveWorkbook.Save

ActiveWorkbook.Sheets("Title Page").Activate

End Sub
---------------------------------------------------------------------------------

Column A is where I want the consecutive number to appear, and Column
is where I want the formula from the above cell to appear, that formul
is :

=IF(F12<=$L$3,"Y","N")

I need the "F12" part to change as it goes down the list.

Thanks for the fast reply, and i hope you can clear it up for me


hume

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel User Form problem


"humet" wrote in message
...
Where would I implement these lines of code into this:

--------------------------------------------------------------------------

----

Private Sub CommandButton1_Click()

ActiveWorkbook.Sheets("Datalist").Activate

Range("A1").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True

ActiveCell.Value = ActiveCell.Offset(-1,0).Value + 1

ActiveCell.Offset(0, 1) = TextBox1.Value

ActiveCell.Offset(0, 2) = TextBox2.Value

ActiveCell.Offset(0, 3) = ComboBox1.Value

ActiveCell.Offset(0, 4) = "=IF(" & ActiveCell.offset(0,5).Address(0,0) & _
"<=$L$3,"Y","N")


ActiveCell.Offset(0, 5) = "=TODAY()"
' if you don't want this value to change, you can use
' ActiveCell.Offset(0, 5) = Date

ActiveCell.Offset(0, 6) = "=YEAR(K13)"

ActiveCell.Offset(0, 7) = TextBox3.Value

ActiveCell.Offset(0, 8) = TextBox4.Value

Call CommandButton2_Click

Range("A1").Select

ActiveWorkbook.Save

ActiveWorkbook.Sheets("Title Page").Activate

End Sub
---------------------------------------------------------------------------
------

Column A is where I want the consecutive number to appear, and Column E
is where I want the formula from the above cell to appear, that formula
is :

=IF(F12<=$L$3,"Y","N")

I need the "F12" part to change as it goes down the list.

Thanks for the fast reply, and i hope you can clear it up for me!


humet


---
Message posted from http://www.ExcelForum.com/


--
Regards,
Tom Ogilvy


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel User Form problem

Thanks again for the extremely fast reply.

But, when I enter this line of code:

ActiveCell.Offset(0, 4) = "=IF(" & ActiveCell.offset(0,5).Address(0,0
& _
"<=$L$3,"Y","N")

I get a compile error: expected: End of statement. It highlights th
Y.

Can this be fixed?

Thanks in advance,

hume

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel User Form problem

My fault, I forgot to double the double quotes within the string. (I was
editing your formula).

ActiveCell.Offset(0, 4) = "=IF(" & _
ActiveCell.Offset(0, 5).Address(0, 0) & _
"<=$L$3,""Y"",""N"")"

--
Regards,
Tom Ogilvy


"humet" wrote in message
...
Thanks again for the extremely fast reply.

But, when I enter this line of code:

ActiveCell.Offset(0, 4) = "=IF(" & ActiveCell.offset(0,5).Address(0,0)
& _
"<=$L$3,"Y","N")

I get a compile error: expected: End of statement. It highlights the
Y.

Can this be fixed?

Thanks in advance,

humet


---
Message posted from http://www.ExcelForum.com/



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
User Form Problem ??? mully New Users to Excel 5 July 2nd 08 11:53 AM
User form problem Freshman Excel Worksheet Functions 3 November 6th 06 05:54 PM
User Form Problem DCSwearingen Excel Discussion (Misc queries) 2 December 30th 05 03:42 PM
User Form Problem DCSwearingen Excel Discussion (Misc queries) 0 December 29th 05 11:04 PM
problem with user form chris[_3_] Excel Programming 1 July 15th 03 03:40 AM


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