Moving to the first empty row in a column below the active cell...

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
917
Office Version
  1. 365
Platform
  1. Windows
How would you rewrite this code
Code:
Range("A10").End(xlDown).Offset(1, 0).Select

so that it works on ANY column?

Thanks for anyone's help.

cr
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Code:
Cells(10, activecell.column).End(xlDown).Offset(1, 0).Select
 
Last edited:
Upvote 0
DanteAmor:
For some reason, something's not working right with this code:
]code]
If ActiveCell.Row <> 26 Then
MsgBox "Must be on row 26!"
Else
MsgBox "cursor on row 26. Proceed"
Cells(26, ActiveCell.Column).Value = Cells(26, ActiveCell.Column).Value + TextBox1.Value 'adds Textbox1.Vlaue to value in row 26
Cells(74, ActiveCell.Column).End(xlDown).Offset(1, 0).Select 'moves to 1st blank row below Comments (row 100)
ActiveCell.Value = ComboBox1.Value 'ineerts Combobox1.value into blank cell
Cells(26, ActiveCell.Column).Select 'returns back to row 26 of Activecolumn
[/code]
Problem with this code: instead of putting a NEW value of Combobox1 BELOW(1st blank cell) the first entered value, it erases that first value and puts the new value into the cell
right below Comments(row 100). I don't want thst. I just want to keep adding values one after the other below the Comments row(row 100) and then saving them.

What's wrong with this code ?

Thanks for all your help, once again.
cr

End If
End Sub
 
Upvote 0
Why : Cells(74, ActiveCell.Column) , why 74?

Forget your code, better tell me what you want to do?
 
Upvote 0
Why : Cells(74, ActiveCell.Column) , why 74?

Forget your code, better tell me what you want to do?

The explanation is not simple. I'll try to make it as short and accurate as possible.
From Uerform1, values are entered and cumulated in row 26 from Textbox1. (30 = 5 + 5 + 10 +10)[each value in paren. represents a separate entry.
Those are the values only. The Item for each entry is listed below a Comments header in row 100 or even on another sheet as each value is entered in row 26.
The net result:

1. row 26 of the activecolumn = 30
2. The Items are listed below the COmments header in row 100:
Oranges - $5
Apples - $5
Grapes - $10
Pears - $10

Reason for doing it this way: to view the Items below Comments that total $30 in row 26 in a separate userform listbox
 
Upvote 0
You could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.

Important: In the file, explain step by step what you intend, explain an example using the data of the sheets themselves.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top