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
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