Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Vba Problem
Name: The Fayth Date: January 12, 2004 at 13:21:50 Pacific OS: Windows XP CPU/Ram: 2.66Ghz / 512Mb
Comment:
Hi Does someone know how to when in VBA, when typing into a user input form, you then press the relevant command button on the form, say 'update' and then that information just entered into teh form will ome up on a row in an excel spreadsheet and then the problem is that how do you code it so that when the data, you've just entered goes into the top row, how will you you go about going straight onto the second row and so forth.
I got this bit of code, but is thee a bit more that goes with it:
Name: egkenny Date: January 12, 2004 at 20:53:12 Pacific
Reply:
There are many ways to do this. You first have to initialize the first cell The following works but can be broken if one clicks on a cell making the active cell move to that point. ------------------------ Public INIT As Boolean ' Private Sub UpdateButton_Click() If INIT = False Then Range("A1").Select INIT = True End If ActiveCell.Value = TextBox1.Text RowOffset = 1 ColumnOffset = 0 ActiveCell.Offset(RowOffset, ColumnOffset).Activate End Sub ============================================= Another way to do this that can't be broken by activating another cell is -------- Public INIT As Boolean Public Row As Integer ' Private Sub UpdateButton_Click() If INIT = False Then Row = 1 INIT = True End If Column = 1 Cells(Row, Column).Value = TextBox1.Text Row = Row + 1 End Sub
0
Response Number 2
Name: The Fayth Date: January 13, 2004 at 01:28:45 Pacific
Summary: I've written a lengthy program in word VBA. The program works fine on most computers, including one with only 64 MB RAM. On some computers (for example, an identical win98 OS q word 2000 with 128 MB R...
Summary: I'm trying to save an excel spreadsheet with the filename of K&N.csv but when I try and do this from within my macro, excel crashes when the workbook is closed. I can save the file and close the workb...
Summary: I try to write a Macro or VBA subroutine, which removes in an Excel sheet all empty (except header) columns and rows, in order to make it more readable as a report. This is probably a trivial thing, b...