I have a simple conversion VBA program made in Excel, which auto_loads when you open the file.The problem is I want it to write the results to a worksheet at the next unused cell.BUTThe code sends it straight to the bottom of the worksheet.heres the code if your good at VBA:Private Sub btnsave_Click()Sheets("Print Sheet").Select Range("B3").Select Selection.End(xlDown).Select Activecall.Offset(1, 0).Activate ActiveCell = lblinput.Caption ActiveCell.Offset(0, 1) = txtinput.Text ActiveCell.Offset(0, 2) = "=" ActiveCell.Offset(0, 3) = lbloutput.Caption ActiveCell.Offset(0, 1) = txtoutput.Text End SubI need help because I can't see why it wont work!Thanks Bob The Nob©
Well for a start, you don't need to do all this selecting - Selecting is a great way to slow things down.Dim LastRow as LongLastrow = Cells(Rows.Count, 1).End(xlUp).Rowwill return the last used row in column A.
I need column B.Range B3:F22
its only a quick college task but I need the last part to work, so it I can look back and use it as a referance for my assignment.Im not bothered about speed
Lastrow = Cells(Rows.Count, 2).End(xlUp).Rowwill find the last row in column B. You should be concerned about speed!
Its only a small program
If you need more help, please ask away.You may not need speed for this but you should try to achieve the best programming technique.If you have to do it, and this should be rarely, then .Activate is preferable to .Select.
Just emailed you VoG™
This thread is now locked and can not be replied to.
Surface Pro (2017) vs Surface Pro 4
20 groundbreaking 3D animation techniques
How to mine Bitcoin on Mac
Synology invites you to visit them at Insomnia on 26th – 29th August. Book your tickets now and visit Synology.
© Copyright 2017 IDG UK. All Rights Reserved.