+ Reply to Thread
Results 1 to 10 of 10

Repeat cell value with said value and auto adjust data accordingly(need Amendment in code)

  1. #1
    Forum Contributor
    Join Date
    08-04-2016
    Location
    pakistan
    MS-Off Ver
    2010
    Posts
    225

    Repeat cell value with said value and auto adjust data accordingly(need Amendment in code)

    Hi All

    in attached, as previous code when i run code repeats row values as mention in column O & other data adjusted accordingly..!
    just required little amend in code that i have added one new column(H) in sheet2 & want to adjust this data in column O in sheet1, all other sequences will remain same like previous..!

    in third sheet(desired) is output
    Adeel
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    Does this work? (Changed 2 lines... they are red)

    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Contributor
    Join Date
    08-04-2016
    Location
    pakistan
    MS-Off Ver
    2010
    Posts
    225

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    thanks Arkadi, this is working perfectly, i have added below online
    ThisWorkbook.Worksheets("Sheet1").Cells.EntireColumn.AutoFit
    after
    For Each cel In .Range("G2:G" & tgtLR)
    cel.Value = "'0" & CStr(cel.Value)
    is this write place..??perhaps this is working
    Adeel

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    I would put it just before
    Please Login or Register  to view this content.
    If it is inside the For loop, then you are repeating the autofit code a lot of times without needing to.

  5. #5
    Forum Contributor
    Join Date
    08-04-2016
    Location
    pakistan
    MS-Off Ver
    2010
    Posts
    225

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    Hi Arkadi
    but that's not working i checked that why i added this line..?

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    As you can see below, I added that line (in red), it ran, and the column widths adjusted fine... what do you mean when you say "not working"


    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-04-2016
    Location
    pakistan
    MS-Off Ver
    2010
    Posts
    225

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    May you missed this line at your first post you can check it
    any how sir, now this is working great thanks for your response and time..!!
    Adeel

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    Another way:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  9. #9
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    Adeel,

    Thanks for the rep, and for marking the thread as solved

    xladept did better than me... I just looked to solve your issue, but he evaluated the code and has come up with something that looks to me as a more elegant and efficient approach to the task...I recommend seeing if it works for you.

  10. #10
    Forum Contributor
    Join Date
    08-04-2016
    Location
    pakistan
    MS-Off Ver
    2010
    Posts
    225

    Re: Repeat cell value with said value and auto adjust data accordingly(need Amendment in c

    Hi Arkadi
    you can do better analysis as which code is better, i just run xladept solution but code need to refine for some data adjustment but i have a solution so i don't want to waste time of you, thanks Arkadi & xladept, keep helping like us
    Adeel

+ 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. VBA Code to Auto Adjust Chart Axes Dependent Upon Cell Entry
    By rhenry54 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2017, 05:21 PM
  2. [SOLVED] VBA Code to Auto Adjust Chart Axes Dependent Upon Cell Entry
    By rhenry54 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2017, 03:32 PM
  3. [SOLVED] Repeat cell value with said value and auto adjust data accordingly
    By adeel1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-10-2017, 12:06 PM
  4. [SOLVED] How to adjust row height of row so tall the point to grab to adjust auto falls below
    By juntjoo in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-22-2016, 02:07 PM
  5. Repeat labels on pivot table need help to adjust vba code
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2016, 07:33 AM
  6. [SOLVED] Userform code for .find function to adjust cell data
    By creekybones in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-20-2012, 04:55 AM
  7. Auto Adjust VBA Code
    By skankingpigeon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2012, 04:31 PM

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