Closed Thread
Results 1 to 10 of 10

about macro code

Hybrid View

girishhb about macro code 01-27-2014, 02:52 AM
Fotis1991 Re: about macro code 01-27-2014, 02:54 AM
girishhb Re: about macro code 01-27-2014, 03:07 AM
:) Sixthsense :) Re: about macro code 01-27-2014, 03:11 AM
Fotis1991 Re: about macro code 01-27-2014, 03:13 AM
girishhb Re: about macro code 01-27-2014, 04:31 AM
Fotis1991 Re: about macro code 01-27-2014, 04:54 AM
jmac1947 Re: about macro code 01-27-2014, 05:34 AM
Pepe Le Mokko Re: about macro code 01-27-2014, 05:39 AM
Fotis1991 Re: about macro code 01-27-2014, 06:36 AM
  1. #1
    Registered User
    Join Date
    01-26-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    14

    about macro code

    Please advise if its possible to insert both the below 2 codes to same sheet(1 to auto update the date when other cell is entered and another is to protect the sheet once data has been inserted. please advise or u merge both the codes and give me. Thanks.

    1, protect the sheet when the data is inserted.

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Cells.Count > 1 Then Exit Sub

    If Not Intersect(Target, Range("A1:F1048576")) Is Nothing Then 'set your range here

    ActiveSheet.Unprotect Password:="mypassword"

    Target.Locked = True

    ActiveSheet.Protect Password:="mypassword"

    End If

    End Sub

    2. auto update the date and time in A column once the data is updated in B column.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng As Range
    Set rng = Target.Parent.Range("B:B")
    If Target.Count > 1 Then Exit Sub
    If Intersect(Target, rng) Is Nothing Then Exit Sub
    If Target.Value = "" Then Target.Offset(0, -1).Value = ""
    If Target.Value <> "" Then Target.Offset(0, -1).Value = Now
    End Sub

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: about macro code

    Welcome to the forum.

    We'd like to help you but first..

    Pls take some minutes to read forum rules and specially-in this case- rules#1 AND 3!!
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    01-26-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: about macro code

    i already read the rules well... once i get correct solution for this definitely i will give more stars and also suggest my friends....

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: about macro code

    Hi girishhb,

    Two things you have to change in your initial thread.

    1) Thread Title Should Be meaningful Heading
    2) You have to apply code tags to your post #1 code.

    That is why Fotis1991 (Moderator) redirected you to the forum rules for making the necessary corrections


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: about macro code

    Quote Originally Posted by girishhb View Post
    i already read the rules well... once i get correct solution for this definitely i will give more stars and also suggest my friends....
    I don't think so...Let's make it clear then.



    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  6. #6
    Registered User
    Join Date
    01-26-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: about macro code

    Please assist me at the earliest since i want to create a report by end of the day today. Kindly please some one help at the earliest......Thankssssssssss

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: about macro code

    Ok. This is my last warning!

    1)Stop bumping your thread. No one will be able to helps you if you don't comply with Moderator request.

    2)Stop sending PM to members asking for help.

    Unfortunately if you continue to do this, soon you'll be a banned user.

  8. #8
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: about macro code

    @fotis1991

    well said, 10 post from a member who joined 26/1/2014 by 27/1/2014 and who doesn't read the rules sounds like someone looking to solve their problem without doing any work, especially as they posted code they clearly don't understand, wonder where they got it from
    (sorry it has been a really bad day in the jmac1947 household today and I am probably a bit grumpy

    jmac
    Last edited by jmac1947; 01-27-2014 at 05:35 AM. Reason: spelling mistakes

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,633

    Re: about macro code

    Astonishing

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...acro-code.html

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: about macro code

    So thread closed and a timeout of few days maybe will helps you to read and understabd the rules of the forum...

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replace Macro recorded code with more effective code
    By scaffdog845 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-12-2014, 01:09 AM
  2. [SOLVED] How to stop a code from running using an another code/macro
    By danjim02 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2013, 08:21 AM
  3. Replies: 0
    Last Post: 05-06-2013, 05:45 AM
  4. Macro code error: code is near complete
    By kashshaikh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2011, 03:22 PM
  5. [SOLVED] do anybody have a sample code for executing excel macro from vb code?<eom>
    By B Deepak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2005, 05:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1