Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default saving after entry in specific cells

I am trying to save a workbook if data is entered in a specific cell. I was
given the following code on this site and I am getting a Compile error that
reads Method or data member not found. I have little knowledge of VBA and I
can not figure out the problem. Any help or suggestions would be greatly
appreciated.
Thanks for the help,
Mike

"Dave Peterson" wrote:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("B7:S38")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default saving after entry in specific cells

Change this line
Set myRng = Sh.Range("B7:S38")
(me becomes sh)



MIke wrote:

I am trying to save a workbook if data is entered in a specific cell. I was
given the following code on this site and I am getting a Compile error that
reads Method or data member not found. I have little knowledge of VBA and I
can not figure out the problem. Any help or suggestions would be greatly
appreciated.
Thanks for the help,
Mike

"Dave Peterson" wrote:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("B7:S38")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default saving after entry in specific cells

Dave,

It eliminates the error message but the sheet isnt saving automatically.
Could I be do something else wrong? Again Thanks for all of your help.


Mike

"Dave Peterson" wrote:

Change this line
Set myRng = Sh.Range("B7:S38")
(me becomes sh)



MIke wrote:

I am trying to save a workbook if data is entered in a specific cell. I was
given the following code on this site and I am getting a Compile error that
reads Method or data member not found. I have little knowledge of VBA and I
can not figure out the problem. Any help or suggestions would be greatly
appreciated.
Thanks for the help,
Mike

"Dave Peterson" wrote:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("B7:S38")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default saving after entry in specific cells

It only saves if there is something in each of the cells in myRng.

Do you have something in each of those cells?

ps.

Change this line:
me.parent.save
to
me.save


MIke wrote:

Dave,

It eliminates the error message but the sheet isnt saving automatically.
Could I be do something else wrong? Again Thanks for all of your help.

Mike

"Dave Peterson" wrote:

Change this line
Set myRng = Sh.Range("B7:S38")
(me becomes sh)



MIke wrote:

I am trying to save a workbook if data is entered in a specific cell. I was
given the following code on this site and I am getting a Compile error that
reads Method or data member not found. I have little knowledge of VBA and I
can not figure out the problem. Any help or suggestions would be greatly
appreciated.
Thanks for the help,
Mike

"Dave Peterson" wrote:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("B7:S38")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default saving after entry in specific cells

Dave,
Sorry for the lack of detail. Is it possible to have it save if one cell in
the range is changed?
Thanks,
Mike

"Dave Peterson" wrote:

It only saves if there is something in each of the cells in myRng.

Do you have something in each of those cells?

ps.

Change this line:
me.parent.save
to
me.save


MIke wrote:

Dave,

It eliminates the error message but the sheet isnt saving automatically.
Could I be do something else wrong? Again Thanks for all of your help.

Mike

"Dave Peterson" wrote:

Change this line
Set myRng = Sh.Range("B7:S38")
(me becomes sh)



MIke wrote:

I am trying to save a workbook if data is entered in a specific cell. I was
given the following code on this site and I am getting a Compile error that
reads Method or data member not found. I have little knowledge of VBA and I
can not figure out the problem. Any help or suggestions would be greatly
appreciated.
Thanks for the help,
Mike

"Dave Peterson" wrote:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("B7:S38")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default saving after entry in specific cells

If it's a single cell on a specific worksheet, then I wouldn't use a workbook
event.

I'd use this kind of code behind that specific worksheet (and delete the
original suggestion).

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRng As Range
Set myRng = Me.Range("a1")

If Intersect(myRng, Target.Cells) Is Nothing Then
Exit Sub
End If

Me.Parent.Save

End Sub



MIke wrote:

Dave,
Sorry for the lack of detail. Is it possible to have it save if one cell in
the range is changed?
Thanks,
Mike

"Dave Peterson" wrote:

It only saves if there is something in each of the cells in myRng.

Do you have something in each of those cells?

ps.

Change this line:
me.parent.save
to
me.save


MIke wrote:

Dave,

It eliminates the error message but the sheet isnt saving automatically.
Could I be do something else wrong? Again Thanks for all of your help.

Mike

"Dave Peterson" wrote:

Change this line
Set myRng = Sh.Range("B7:S38")
(me becomes sh)



MIke wrote:

I am trying to save a workbook if data is entered in a specific cell. I was
given the following code on this site and I am getting a Compile error that
reads Method or data member not found. I have little knowledge of VBA and I
can not figure out the problem. Any help or suggestions would be greatly
appreciated.
Thanks for the help,
Mike

"Dave Peterson" wrote:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("B7:S38")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default saving after entry in specific cells

Dave,


Works great. Thanks for all of your help.

Mike


"Dave Peterson" wrote:

If it's a single cell on a specific worksheet, then I wouldn't use a workbook
event.

I'd use this kind of code behind that specific worksheet (and delete the
original suggestion).

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRng As Range
Set myRng = Me.Range("a1")

If Intersect(myRng, Target.Cells) Is Nothing Then
Exit Sub
End If

Me.Parent.Save

End Sub



MIke wrote:

Dave,
Sorry for the lack of detail. Is it possible to have it save if one cell in
the range is changed?
Thanks,
Mike

"Dave Peterson" wrote:

It only saves if there is something in each of the cells in myRng.

Do you have something in each of those cells?

ps.

Change this line:
me.parent.save
to
me.save


MIke wrote:

Dave,

It eliminates the error message but the sheet isnt saving automatically.
Could I be do something else wrong? Again Thanks for all of your help.

Mike

"Dave Peterson" wrote:

Change this line
Set myRng = Sh.Range("B7:S38")
(me becomes sh)



MIke wrote:

I am trying to save a workbook if data is entered in a specific cell. I was
given the following code on this site and I am getting a Compile error that
reads Method or data member not found. I have little knowledge of VBA and I
can not figure out the problem. Any help or suggestions would be greatly
appreciated.
Thanks for the help,
Mike

"Dave Peterson" wrote:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

dim myRng as range
set myrng = me.range("B7:S38")

if myrng.cells.count = application.counta(myrng) then
me.parent.save
end if

End Sub

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pop up message upon specific cell entry? matt ball Excel Discussion (Misc queries) 8 June 14th 08 03:00 PM
Require specific cell entry before saving file Patrick Riley Excel Discussion (Misc queries) 1 March 21st 08 04:46 PM
Require specific cell entry before saving file Patrick Riley Excel Discussion (Misc queries) 2 March 20th 08 03:50 PM
Cell Entry That Locks Selected Cells From Any Data Entry. ron Excel Worksheet Functions 5 February 16th 07 09:52 PM
Is there away to have specific cells unlock based on the entry of information in another? Marc New Users to Excel 2 April 17th 05 06:09 PM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"