+ Reply to Thread
Results 1 to 8 of 8

Rename multiple cell

  1. #1
    Registered User
    Join Date
    07-03-2014
    Location
    Melaka
    MS-Off Ver
    Excel 2010
    Posts
    21

    Rename multiple cell

    how to rename 12 cell at one time? I used below code but I dont seem it like a proper way because it is too long.

    Worksheets("Sheet1").Range("C7").Value = "Jan"
    Worksheets("Sheet1").Range("D7").Value = "Feb"
    Worksheets("Sheet1").Range("E7").Value = "Mar"
    Worksheets("Sheet1").Range("F7").Value = "Apr"
    Worksheets("Sheet1").Range("G7").Value = "May"
    Worksheets("Sheet1").Range("H7").Value = "Jun"
    Worksheets("Sheet1").Range("I7").Value = "Jul"
    Worksheets("Sheet1").Range("J7").Value = "Aug"
    Worksheets("Sheet1").Range("K7").Value = "Sep"
    Worksheets("Sheet1").Range("L7").Value = "Oct"
    Worksheets("Sheet1").Range("M7").Value = "Nov"
    Worksheets("Sheet1").Range("N7").Value = "Dis"

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Rename multiple cell

    Hi,

    What exactly you want to do with the code? Do you want to find/replace within the code or reduce the number of line of code.

    If you want to reduce the line of code, follow the below steps:

    Please Login or Register  to view this content.

    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Rename multiple cell

    welcome to the forum. not a vba expert, but this may come in useful too if you have non dates & texts sort of data you wanna fill:
    Please Login or Register  to view this content.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    07-03-2014
    Location
    Melaka
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Rename multiple cell

    actually i want to name all the 12 cells from range C7:N7 with months..
    and i think code that i stated above is too long even though its working.
    should i you array? i found these code but i don't know what is wrong with the code
    im still new in these vba codes..

    Sub test()
    Dim month As Variant

    Worksheets("Sheet1").Range("C7:N7").Value = month
    month = Array("Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dis")
    End Sub

  5. #5
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Rename multiple cell

    Hi,

    One slight mistake with your above code, just check this:

    Please Login or Register  to view this content.

    Regards,
    Paresh J

  6. #6
    Registered User
    Join Date
    07-03-2014
    Location
    Melaka
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Rename multiple cell

    yes! thanks. it works!!!

  7. #7
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: Rename multiple cell

    Hi airbatucampur92,

    If you think you got your solution then please mark this thread as SOLVED and click * Add reputation as way to say thanks!!!!


    Regards,
    Paresh J

  8. #8
    Registered User
    Join Date
    07-03-2014
    Location
    Melaka
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Rename multiple cell

    thanks! it works!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to Rename Multiple sheets using right function based on a cell
    By choleb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2013, 01:40 PM
  2. [SOLVED] Rename Multiple worksheet based on what is contained in one cell in that sheet.
    By pjmc84 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-16-2013, 11:20 AM
  3. Rename Cell Values (Multiple Conditions)
    By snorkal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-11-2012, 10:48 AM
  4. Rename cell based on file name for multiple files
    By lmolokin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 05:49 PM
  5. [SOLVED] How do you rename Multiple files using text from a cell in the file?
    By RandyR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2005, 03:05 PM

Tags for this Thread

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