ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Automating Excel (Macros) (https://www.excelbanter.com/new-users-excel/146025-automating-excel-macros.html)

Outlook Convert

Automating Excel (Macros)
 
Is it possible to create a macro that will move down a certain number of
cells (for example, 10 cells) and then enter a number? Thanks in advanced.

Trevor Shuttleworth

Automating Excel (Macros)
 
This will move down 10 rows and insert the row number ... as an example.

Sub test()
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = ActiveCell.Row
End Sub

Regards

Trevor


"Outlook Convert" wrote in
message ...
Is it possible to create a macro that will move down a certain number of
cells (for example, 10 cells) and then enter a number? Thanks in advanced.




Outlook Convert

Automating Excel (Macros)
 
Does this require VBA knowledge? If so, I don't know VBA. Where (what
screen) would I enter what you typed? I don't want this macro to insert a
row number - I want it to insert a number that I provide. Thanks.

"Trevor Shuttleworth" wrote:

This will move down 10 rows and insert the row number ... as an example.

Sub test()
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = ActiveCell.Row
End Sub

Regards

Trevor


"Outlook Convert" wrote in
message ...
Is it possible to create a macro that will move down a certain number of
cells (for example, 10 cells) and then enter a number? Thanks in advanced.





Trevor Shuttleworth

Automating Excel (Macros)
 
Sub test2()
NumberToBeInput = InputBox("Enter a Number", "Input", 1)
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = NumberToBeInput
End Sub

When in Excel, press Alt-F11 to open the Visual Basic Editor (VBE)

Select Insert | Module and then paste the code

Regards

Trevor


"Outlook Convert" wrote in
message ...
Does this require VBA knowledge? If so, I don't know VBA. Where (what
screen) would I enter what you typed? I don't want this macro to insert a
row number - I want it to insert a number that I provide. Thanks.

"Trevor Shuttleworth" wrote:

This will move down 10 rows and insert the row number ... as an example.

Sub test()
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = ActiveCell.Row
End Sub

Regards

Trevor


"Outlook Convert" wrote in
message ...
Is it possible to create a macro that will move down a certain number
of
cells (for example, 10 cells) and then enter a number? Thanks in
advanced.







Outlook Convert

Automating Excel (Macros)
 
Excellent! It worked Trevor! Thanks!

"Trevor Shuttleworth" wrote:

Sub test2()
NumberToBeInput = InputBox("Enter a Number", "Input", 1)
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = NumberToBeInput
End Sub

When in Excel, press Alt-F11 to open the Visual Basic Editor (VBE)

Select Insert | Module and then paste the code

Regards

Trevor


"Outlook Convert" wrote in
message ...
Does this require VBA knowledge? If so, I don't know VBA. Where (what
screen) would I enter what you typed? I don't want this macro to insert a
row number - I want it to insert a number that I provide. Thanks.

"Trevor Shuttleworth" wrote:

This will move down 10 rows and insert the row number ... as an example.

Sub test()
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = ActiveCell.Row
End Sub

Regards

Trevor


"Outlook Convert" wrote in
message ...
Is it possible to create a macro that will move down a certain number
of
cells (for example, 10 cells) and then enter a number? Thanks in
advanced.







Trevor Shuttleworth

Automating Excel (Macros)
 
You're welcome. Thanks for the feedback.

Regards

Trevor


"Outlook Convert" wrote in
message ...
Excellent! It worked Trevor! Thanks!

"Trevor Shuttleworth" wrote:

Sub test2()
NumberToBeInput = InputBox("Enter a Number", "Input", 1)
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = NumberToBeInput
End Sub

When in Excel, press Alt-F11 to open the Visual Basic Editor (VBE)

Select Insert | Module and then paste the code

Regards

Trevor


"Outlook Convert" wrote in
message ...
Does this require VBA knowledge? If so, I don't know VBA. Where (what
screen) would I enter what you typed? I don't want this macro to
insert a
row number - I want it to insert a number that I provide. Thanks.

"Trevor Shuttleworth" wrote:

This will move down 10 rows and insert the row number ... as an
example.

Sub test()
ActiveCell.Offset(10, 0).Select
ActiveCell.Value = ActiveCell.Row
End Sub

Regards

Trevor


"Outlook Convert" wrote in
message ...
Is it possible to create a macro that will move down a certain
number
of
cells (for example, 10 cells) and then enter a number? Thanks in
advanced.










All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com