Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help with Visual Basic programming

Hi all,

I'm trying to write a macro so that when information is entered into a form
I have created it will be inputed automatically into one of the worksheets
when I hit the submit button. I have been able to do this but need it to
recognise that if there is all ready information in that line rather than
overwriting the information, it skips down to the next line where there is no
information.

Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help with Visual Basic programming

set cell = Worksheets("Sheet2").Range("A2")
do while not isemtpy(cell)
set cell = cell.offset(1,0)
Loop
Cell.Value = Userform1.Textbox1.Text
cell.offset(0,1).Value = Userform1.Textbox2.Text

--
Regards,
Tom Ogilvy




"phoenixx153" wrote in message
...
Hi all,

I'm trying to write a macro so that when information is entered into a

form
I have created it will be inputed automatically into one of the worksheets
when I hit the submit button. I have been able to do this but need it to
recognise that if there is all ready information in that line rather than
overwriting the information, it skips down to the next line where there is

no
information.

Is this possible?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Visual Basic programming


Sub Tst2()
Dim varnbrows As Double
Range("A1").Select
varnbrows = Selection.CurrentRegion.Rows.Count
If Selection.Value = "" Then
Exit Sub
ElseIf Selection.Offset(1, 0).Value = "" Then
Selection.Offset(1, 0).Select
Else
Selection.Offset(varnbrows, 0).Select
End If
End Sub

this code will take you to the first emty cell in column A

and once there you can paste your record
you can change the column in the cod

--
davesexce
-----------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...fo&userid=3170
View this thread: http://www.excelforum.com/showthread.php?threadid=51674

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
Visual Basic Programming for Excel Venkatesh New Users to Excel 4 August 6th 07 11:48 AM
Visual Basic programming Jannick Excel Discussion (Misc queries) 2 February 27th 06 02:23 PM
Help! complicated programming visual basic Lisa Excel Programming 2 February 19th 06 06:23 PM
A few problems Programming to the Visual Basic Editor Chip Pearson Excel Programming 2 September 17th 03 05:18 AM
Visual Basic Programming Difficulties with linking Userforms Chuckie Excel Programming 2 August 7th 03 09:08 PM


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