Hi all
I am trying a project in vb6
I have 10 command buttons and 10 text boxes with some data holded
i transferred all the data as a complete record to an Excel file via vb6 code
tell you bit clearly with 4 controls i used in my work
my 1st command button is
Caption : BooksNames
Name : cmdTBooksNames
my 2nd command button is
Caption : No of books
Name : cmdTNoOfBooks
my 1st text box is
Name : txtBooksNames
Text : ""
my 2nd text box is
Name : txtNoOfBooks
when i execute my program, the user will give 2 inputs
i created the code in vb6 to pass those values to excel sheet
Also i have coded the excel sheet via vb6 to locate the received values in specified cells like the code follows
**************************************
oXLSheet.Range("A1") = TBksNames
oXLSheet.Range("B1") = BksNames
oXLSheet.Range("A2") = TNoOfBks
oXLSheet.Range("B2") = NoOfBks
************************************************** **
For example,Now i have the values from the range A1 to B2
Everything going good
But when i execute my program once again, the vaues which i am giving for the second time replacing the existing data
So,i googled and i found the following snippet to find the first unused row in the excel sheet so that i can find the activated row to transfer my second record
************************************************** **
Set oXLRange = oXLSheet.UsedRange
oXLRange.SpecialCells(xlCellTypeLastCell).Activate
newStartingRow = oXLApp.ActiveCell.Row + 1
newStartingCell = "A" & newStartingRow
oXLApp.Range(newStartingCell).Activate
************************************************** ***
But the problem here is , I have to code again by changing the cell's address,like
************************************************** *
oXLSheet.Range("A3") = TBksNames
oXLSheet.Range("B3") = BksNames
oXLSheet.Range("A4") = TNoOfBks
oXLSheet.Range("B4") = NoOfBks
************************************************** *
It becomes more complicated if i want to add 10 records per day
I feel frustrated to code again
is there any possibities to duplicate the activated cell address as "A1:B2",but saving the record next to the existing record automatically
please i neeed some idea
help me out
thank you