+ Reply to Thread
Results 1 to 8 of 8

OFFSET FROM SELECTION and insert formula

  1. #1
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    OFFSET FROM SELECTION and insert formula

    HI

    i would like an excel VBA to do the following

    i would like to select a range in a column lets say from A1 to A10 and i want that automatically when i run the macro, in the next column right next to where i selected it should input a function for ex =len(a1)

    thanks

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: OFFSET FROM SELECTION and insert formula

    Hello
    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: OFFSET FROM SELECTION and insert formula

    You could do this by typing =LEN(A1) into cell B1 and dragging down

    So I am thinking that I am not fully understanding what you want, and that you are looking for something else...
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: OFFSET FROM SELECTION and insert formula

    thanks that worked, I just want to add one more thing that if anything in my selection contains the "-" symbol it should remove it

    thanks

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: OFFSET FROM SELECTION and insert formula

    Use that line
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: OFFSET FROM SELECTION and insert formula

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: OFFSET FROM SELECTION and insert formula

    HI

    one more question how can i have two formulas for ex.

    .Formula = "=len(SUBSTITUTE(...

    i cant seem to figure it out

    thanks

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: OFFSET FROM SELECTION and insert formula

    You did not mention which post you were referring to but is this what you mean?
    Please Login or Register  to view this content.

+ 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 insert formula referencing offset cells and anchor reference
    By JPalms in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-19-2013, 10:35 AM
  2. [SOLVED] Code to insert formula depending on CheckBox Selection
    By gautamacharya in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2012, 06:47 PM
  3. Help - Insert method of Range class failed - Selection.Insert Shift:=xlToRight
    By sandy@excelforum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2012, 11:14 AM
  4. adding dynamic formula inside loop to insert into offset cell
    By smartphreak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2011, 02:57 AM
  5. Reformatting - insert formula with offset, then offset to next cell
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2011, 05:41 AM
  6. Using offset formula but its not updating after i insert rows
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-24-2011, 02:57 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