Results 1 to 4 of 4

Random Letter Copy and paste-Little help for a beginner

Threaded View

  1. #1
    Registered User
    Join Date
    03-02-2012
    Location
    Toulouse
    MS-Off Ver
    Excel 2007
    Posts
    24

    Question Random Letter Copy and paste-Little help for a beginner

    Hello everyone,

    I have been "playing" with excel macros for the first time in my life in the last two hours and here is the first doubt that I have not been able to solve by myself. I know it must be very easy, but please, don't be so hard on me.

    I want to introduce a random letter in a cell. That is what I have tried:

    Sub letra_aleat_lista_1()
        Range("C9").Select
        ActiveCell.FormulaR1C1 = "=CHAR(65+RAND()*26)"
        Selection.Copy
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    End Sub
    As you see, I use the random character function and I do a "copy-special paste" in order to get rid of the function itself and keeping just the value, so it won't ever change. What I don't like about this is that the cell keeps selected with that twinkling edge that appears after doing ctrl+c, and I don't want that. If I were not using a macro I would press ESC, but I don't know how to make the macro do this.

    Well, that is my problem and my rudimentary attempted solution.

    I would also want to ask for a good source of information to avoid posting this kind of threads in the future.

    Thanks in advance.
    Last edited by davesexcel; 03-02-2012 at 08:57 PM. Reason: Title needs editing

Thread Information

Users Browsing this Thread

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

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