LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default do .... loop


Hi,

I'm trying to use the Do loop in my coding but am getting no where.

I have already prompted the user with an input box asking for thei
name.

I have a list of names in sheet2
My aim is to start at the beginning of the list and move down th
column one cell at a time until i reach an empty cell. When I get t
the empty cell, i want input the new name that the user has jus
inputed.

Currently i have:


Public Sub AddNames()

Worksheets("Sheet1").Select
Range("B2").Select

Dim FirstName As String
FirstName = InputBox("What is your firstname?", "First Name")
ActiveWorkbook.Worksheets("sheet1").Range("B2").Va lue = FirstName

Dim SurName As String
SurName = InputBox("What is your surname?", "Surname Name")
ActiveWorkbook.Worksheets("sheet1").Range("B2").Of fset(0, 1).Value
SurName

Worksheets("Sheet2").Select
Range("A2").Select

Do Until IsEmpty(ActiveCell)

ActiveCell.Value = FirstName
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = SurName

Exit Do
Loop


I am sure there is something wrong with the coding after "D
Untill...". Any help would be REALLY appreciated. Thank

--
nhan
-----------------------------------------------------------------------
nhanh's Profile: http://www.excelforum.com/member.php...fo&userid=1501
View this thread: http://www.excelforum.com/showthread.php?threadid=26670

 
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
Loop Christina Excel Discussion (Misc queries) 1 March 17th 10 07:40 PM
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
Do Until Loop Hargrove[_2_] Excel Programming 2 August 11th 04 12:25 AM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


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