Create copy paste save sequence to Form control button2

Gre44

New Member
Joined
Jan 18, 2019
Messages
6
Hello,


Very new to this, but wanted to ask a series of questions I am stuck on


With a spreadsheet that is already designed and formatted
Using a 'developer form button' that is in 1 place on the
spreadsheet A1.
Every time the 'New' button is clicked it creates a new set of A-E to write in
for inventory control. The only place allowed to write in is inside the created
'cells'


I want to be able to:


unprotect sheet


Copy columns/rows A2 - E8


Select "next available" row on column A

Paste on columns A-E (A-E Always)
There are 7 rows


Create Seq number (starts in A3, so the next is A10, etc)


paste add formula: (starting with number (25000) in A2, the next
number will be 25001, and so on (25002, 25003, etc) every seven rows.
Needs to be able to compare all of rowA to make sure it is the next sequential number
(FYI the number 25000 or lower can never be used)
ie starting from A2 numbers increase by +1 and appear in the box
7 rows below (still A column) where that number currently appears.
or scan column A and the next number (<25000) displayed in A2 + 7 rows to next A slot
(ie 25001, 25002, 25003, etc)


End copy paste sequence (dotted lines)


Save Document


Re-protect document

That is it.
This is what I have done so far.
The Paste range is, of course, wrong.




Sub Button2_Click()
'
' Button2_Click Macro
' unprot-copypaste-Save-prot
'


'
ActiveSheet.Unprotect
Range("A2:E8").Select
Selection.Copy
Range("A9").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False
ActiveWorkbook.Save
End Sub


 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Forgot to mention. Also, there are no 'values' in some of the 7 row 'blocks' being created.
2 of the cells in column A have integers, but the rest only have colors.

Wanting to create new blocks below the current ones and give it a new number (control number).
The blocks are A-E, and 7 rows deep each.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-pr...ste-save-sequence-to-form-control-button.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Fluff

Thank you. I will add the links above. I wasn't sure if the 2 sites were somehow linked.
If they were not, Rule 10.
And also put the code in code tags.
Really new to this and really appreciate any type of feedback.
 
Upvote 0
This is what I have so far.

Code:
[COLOR=#333333][FONT=Verdana]Sub Button2_Click()[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]' Button2_Click Macro[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]' unprot-copypaste-Save-prot[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]
[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]'[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]ActiveSheet.Unprotect[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Range("A2:E8").Select[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Selection.Copy[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Range("A9").Select[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]ActiveSheet.Paste[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]Application.CutCopyMode = False[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]False[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]ActiveWorkbook.Save[/FONT][/COLOR]
[COLOR=#333333][FONT=Verdana]End Sub[/FONT][/COLOR]
 
Upvote 0
Firstly, the two sites are not linked in way. But both have similar rules regarding cross-posting.
Secondly, Rule#10 has nothing to do with cross-posting.

I would suggest that you take the time to read our rules.
 
Upvote 0
Thank you so much
I wanted to ask, should I delete this post and re-post this into one of the 2 forums?

I have no problem with this. Was just eager.
Either way, this is obviously just the new guy trying to learn how to use the forum.
Really sorry I didn't read the rules more closely.
That being said, if I wanted to delete this thread, would I communicate to a moderator through
'Report', or just write it in here?
 
Upvote 0
There is no need to delete this thread.
If you get a solution on the other site, we would ask that you post it here & vice versa.
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,680
Members
449,091
Latest member
peppernaut

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