I have pasted the VBA code below for a project I am working on. Having an issue where the second iteration overwrites the first result, but then the worksheet functions normally. Can't find where the problem is. Appreciate any help!
Private Sub SendInfo_Click()
'Variable Creation
Dim NextRow As Long
'Activate Sheet2
Sheets("Input Page").Activate
'Shift Rows Down
Range("A7:G7").Select
Selection.Copy
Range("A7:G7").Select
Selection.Insert Shift:=xlDown
'Discover empty Row
NextRow = Application.WorksheetFunction.CountA(Range("B:B")) + 1
'Description
Cells(NextRow, 2) = Description.Text
'Category
If RentCat Then Cells(NextRow, 3) = "Rent"
If RStepCat Then Cells(NextRow, 3) = "Rent Steps"
If TICAT Then Cells(NextRow, 3) = "Tenant Improvement Allowance"
If LLWorkCat Then Cells(NextRow, 3) = "Landlord Work"
If LCICAT Then Cells(NextRow, 3) = "Lease Capital- Inside"
If LCOCAT Then Cells(NextRow, 3) = "Lease Capital- Outside"
'Characterization
If Onetime Then Cells(NextRow, 4) = "One-Time"
If Recurring Then Cells(NextRow, 4) = "Recurring"
If Upfront Then Cells(NextRow, 4) = "Upfront"
'Month Occurs
Cells(NextRow, 5) = MonthOccursText.Text
'Months Recurring
Cells(NextRow, 6) = MonthsRecurText.Text
'Growth
'Cells(NextRow, 7) = GrowthText.Text
'If Cells(NextRow, 7) > 0 Then Cells(NextRow, 7).Value = GrowthText.Value / 100 Else
'Cells(NextRow, 7).Value = GrowthText.Value / 100
'.Offset(RowCount, 6).Value = Me.txt_forv_timer.Value / 100
'.Offset(RowCount, 7).Value = Me.txt_forv_oms.Value / 100
'DollarAmount
Cells(NextRow, 7) = DollarAmount.Text
'Close
Unload Me
End Sub
The problem is the way I am selecting/defining NextRow. I just want it to constantly by row 7. How do I do that?
Solved. Amazing. NextRow = 7
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks