macro to Fill series till last selected cells

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
Hello,
I need to accomplish to get a macro that will auto fill series on the selected range in a column. the first selected cell in the range will always be a number. and selection will always the in column A. however, the selected range will not always be the same.

ex1: if cell A5 = 1 and if users selects range A5:A10 the press the macro results should be the following:
A6=2
A7=3
A8=4
A9=5
A10=6

the macro counts till the last selected row.

Ex2 if Cell A50=67 and user selects range A50:A66 and press the macro it should give the following:
A51=68
A52=69
A53=70
A54=71
A55=72....ETC

and fill till the last cell selected in this case A66=83.
 
Thanks Peter_SSs Im getting the following Error Message
When you get this error, can you provide the following information?
- what range was selected
- what value was in the first cell in the range
- what rows were hidden

That way I could try to reproduce the problem & investigate as I have not had any error messages with the values/ranges that I have tested with.
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
- what range was selected (range A15:A97)
- what value was in the first cell in the range (A15=1)
- what rows were hidden (17:51, 59:96)
 
Upvote 0
Thanks. With that arrangement, I have not been able to reproduce the error.

Does the code work if you select a column range that has no hidden cells (with a 1 in the first cell)?
Has the code worked in any of your tests?
Before running the code, are there any values at all in cells A16:A97, including any of the hidden cells?
Do you have any merged cells?
 
Upvote 0

Forum statistics

Threads
1,224,750
Messages
6,180,740
Members
452,996
Latest member
nelsonsix66

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