Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John in Surrey
 
Posts: n/a
Default Fill Cell to the right

Hi folks
I wish to paste data from a form into the first aviable row (bed) of
our ward database...

Private Sub cmdAdmitPatient_Click()
For Each c In Worksheets("admission").Range("B5:B29")
If c.Value = " " Or c.Value = "" Then
c.Value = txtName.Value
'<cell to the right = txtDateOfBirth.Value
'<cell to the right again = txtNextOfKin
Exit For
End If
Next
End Sub

as you can see, Ive found the first blank row / bed and pasted in the
patient name, how do I move to the right one cell to paste the DOB
then ditto again for the next field

thanks
john
Images of home (NZ)
http://www.titahi-bay.co.nz/home
What we are up to in the UK
http://www.titahi-bay.co.nz
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Fill Cell to the right

Private Sub cmdAdmitPatient_Click()
dim c as range
For Each c In Worksheets("admission").Range("B5:B29").cells
If trim(c.Value) = "" Then
c.Value = txtName.Value
c.offset(0,1).value = txtDateOfBirth.Value
c.offset(0,2).value = txtNextOfKin
Exit For
End If
Next c
End Sub

John in Surrey wrote:

Hi folks
I wish to paste data from a form into the first aviable row (bed) of
our ward database...

Private Sub cmdAdmitPatient_Click()
For Each c In Worksheets("admission").Range("B5:B29")
If c.Value = " " Or c.Value = "" Then
c.Value = txtName.Value
'<cell to the right = txtDateOfBirth.Value
'<cell to the right again = txtNextOfKin
Exit For
End If
Next
End Sub

as you can see, Ive found the first blank row / bed and pasted in the
patient name, how do I move to the right one cell to paste the DOB
then ditto again for the next field

thanks
john
Images of home (NZ)
http://www.titahi-bay.co.nz/home
What we are up to in the UK
http://www.titahi-bay.co.nz


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John in Surrey
 
Posts: n/a
Default Fill Cell to the right

On Mon, 02 Jan 2006 13:58:29 -0600, Dave Peterson
wrote:
thanks to dave and don


Images of home (NZ)
http://www.titahi-bay.co.nz/home
What we are up to in the UK
http://www.titahi-bay.co.nz
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
Cell borders and fill Marietta Excel Worksheet Functions 4 August 6th 05 04:29 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
auto fill data into a cell from a lookup table Tetradpoint Excel Discussion (Misc queries) 1 April 19th 05 04:46 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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