ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Form Show Error (https://www.excelbanter.com/excel-programming/354282-form-show-error.html)

gti_jobert[_35_]

Form Show Error
 

Hi all,

I have the following code in a cmd button on a sheet;


Code
-------------------

If r = vbYes Then

ActiveSheet.Unprotect Password:=Pass

Range(Cells(start, 1), Cells(finish, 18)).Select
Selection.Copy
Call FindNextEmpty
ActiveCell.Offset(0, -6).Select
Selection.PasteSpecial Paste:=xlValues

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDot
.Weight = xlThin
.ColorIndex = xlAutomatic
End With

For i = start To finish
ActiveSheet.Rows(start).Delete
Next
Range("A2").Select
ActiveSheet.Protect Password:=Pass

*frmMain.Show*

End If

-------------------


Keep getting an error saying 'Invalid Property Value'? any ideas

--
gti_jober
-----------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...fo&userid=3063
View this thread: http://www.excelforum.com/showthread.php?threadid=51615


gti_jobert[_36_]

Form Show Error
 

Hi,

I have identified that if i do the following code;


Code
-------------------

If r = vbYes Then

ActiveSheet.Unprotect Password:=Pass

Range(Cells(start, 1), Cells(finish, 18)).Select
Selection.Copy
Call FindNextEmpty
ActiveCell.Offset(0, -6).Select
Selection.PasteSpecial Paste:=xlValues

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDot
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
* frmMain.Show*
For i = start To finish
ActiveSheet.Rows(start).Delete
Next
Range("A2").Select

ActiveSheet.Protect Password:=Pass

End If

-------------------


the form will then show but the rows will not delete - because
different sheet is activated when the form loads. Why does the form no
load when placed under the delete rows loop?

Any ideas appreciated.

--
gti_jober
-----------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...fo&userid=3063
View this thread: http://www.excelforum.com/showthread.php?threadid=51615


funkymonkUK[_93_]

Form Show Error
 

gti_jobert Wrote:
Hi,

I have identified that if i do the following code;


Code
-------------------

If r = vbYes Then

ActiveSheet.Unprotect Password:=Pass

Range(Cells(start, 1), Cells(finish, 18)).Select
Selection.Copy
Call FindNextEmpty
ActiveCell.Offset(0, -6).Select
Selection.PasteSpecial Paste:=xlValues

With Selection.Borders(xlEdgeBottom)
.LineStyle = xlDot
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
* frmMain.Show*
For i = start To finish
ActiveSheet.Rows(start).Delete
Next
Range("A2").Select

ActiveSheet.Protect Password:=Pass

End If

-------------------


the form will then show but the rows will not delete - because
different sheet is activated when the form loads. Why does the for
not load when placed under the delete rows loop?

Any ideas appreciated..


do you close the form down

--
funkymonkU
-----------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813
View this thread: http://www.excelforum.com/showthread.php?threadid=51615


gti_jobert[_38_]

Form Show Error
 

At this point in the application, the form is initialising for the first
time.


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=516154



All times are GMT +1. The time now is 12:05 PM.

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