Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88087

Update/Edit Data - VBA Excel

$
0
0

enter image description hereI have looked through the pages and cannot seem to find an answer. Any help is greatly appreciated. I have gotten the code to work for updating the data in the sheet from from VBA form however it just keeps writing over the top row and does not edit the specific rows data. I am trying to get it to edit the data that is showing and not overwrite the top lines data. any help is appreciated. The code I am using is:

Private Sub cmdupdate_Click()

 Dim rowselect As Single
 rowselect = rowselect + 2
 Rows(rowselect).Select

 Cells(rowselect, 1) = Me.txtname.Value
 Cells(rowselect, 2) = Me.txtposition.Value
 Cells(rowselect, 3) = Me.txtassigned.Value
 Cells(rowselect, 4) = Me.cmbsection.Value
 Cells(rowselect, 5) = Me.txtdate.Value
 Cells(rowselect, 7) = Me.txtjoint.Value
 Cells(rowselect, 8) = Me.txtDAS.Value
 Cells(rowselect, 9) = Me.txtDEROS.Value
 Cells(rowselect, 10) = Me.txtDOR.Value
 Cells(rowselect, 11) = Me.txtTAFMSD.Value
 Cells(rowselect, 12) = Me.txtDOS.Value
 Cells(rowselect, 13) = Me.txtPAC.Value
 Cells(rowselect, 14) = Me.ComboTSC.Value
 Cells(rowselect, 15) = Me.txtTSC.Value
 Cells(rowselect, 16) = Me.txtAEF.Value
 Cells(rowselect, 17) = Me.txtPCC.Value
 Cells(rowselect, 18) = Me.txtcourses.Value
 Cells(rowselect, 19) = Me.txtseven.Value
 Cells(rowselect, 20) = Me.txtcle.Value

 End Sub

Viewing all articles
Browse latest Browse all 88087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>