Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok heres the thing,
Im trying to make it so that a inputbox is prompted and the result is entered into the worksheet. Heres my problem, i can get it to insert onto a singlecell but i was wondering how do i make it so that it checks the cell above it to see if its empty and if it is how do i make it enter the result from the inputbox onto the next row? So far ive got Private Sub CommandButton1_Click() 'declare variables as types Dim saveURL As String 'gets title from user saveURL = InputBox(Prompt:="Please enter the title of the URL:", _ Title:="Enter Title of URL", Default:="(enter URL title)") 'check to see if cell is empty [dont know how to do this] Attachment filename: mylinks.xls Download attachment: http://www.excelforum.com/attachment.php?postid=583983 --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This line of code will give you the last row used in column A
RowNo = Range("a" & Rows.Count).End(xlUp).Row This line of code will give you the row beneath the last used row i column A RowNo = Range("a" & Rows.Count).End(xlUp).Row + -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i understand whats going on in that line of code but how would
implement it so that i can insert something into the active cell (eg. cell a2 contains Hello and i want it to find that cell and go 1 belo it and input 'World' into cell a3 automatically? ______________________________________ |_______|___A___|___B___|___C___|__D___| |__1____|_______|_______|_______|______| |__2____|_HELLO_|_______|_______|______| |__3____|_world _|_______|_______|______| <-inserted using |__4____|_______|_______|_______|______| inputbox |__5____|_______|_______|_______|______| |__6____|_______|_______|_______|______| |__7____|_______|_______|_______|______ -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Range("A1").Select Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select End If Loop Until IsEmpty(ActiveCell) = True Instead of A1, put whatever cell you are wanting to start at. if you are wanting to go down a row, the offset should be 1, 0. if yo are wanting to go right one cell, 0, 1 -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton1_Click()
'declare variables as types Dim saveURL As String 'gets title from user saveURL = InputBox(Prompt:="Please enter the title of the URL:", _ Title:="Enter Title of URL", Default:="(enter URL title)") 'check to see if cell is empty Range("A1").Select Do If IsEmpty(ActiveCell) = False Then ActiveCell.Offset(1, 0).Select End If Loop Until IsEmpty(ActiveCell) = True activecell.value = inputbox.tex -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
herosbond
Try If Trim(UserForm1.TextBox1.Text) < "" Then Cells(Range("b" & Rows.Count) _ .End(xlUp).Row + 1, "b").Value _ = UserForm1.TextBox1.Text UserForm1.TextBox1.Text = "" End I -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 Macro/VB Question DDE Question | Excel Worksheet Functions | |||
If question | Excel Discussion (Misc queries) | |||
where can I see my question and answer? Yesterday I ask a question | Excel Discussion (Misc queries) | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions |