+ Reply to Thread
Results 1 to 6 of 6

[VBA]: set cell equal to a cell in another column(same row) if empty

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    [VBA]: set cell equal to a cell in another column(same row) if empty

    Hello Ex(cel)perts. Im working on a macro that looks at column headers to perform some actions on the corresponding cells. I'm almost done with the VBA except for one thing that's making me bang my head on walls, I want to look at the cell to check if it's length is less than 8 and substitute from another cell if true. Both the cells are in same row but order of columns may change in every sheet/book, that is why I look for a column using its header.

    My code so far looks like this:
    Please Login or Register  to view this content.
    Please pardon me if my code is inconsistent, I'm an amatuer. The code may look incomplete, because i have picked a part of the code that is relevant, macro is working fine without errors.

    Please look at the section that reads "Creates Priority Date column"(3rd from the end) I need help there.

    sample.PNG

    In above sample,
    1. For row 2, I want PRD column to retain its value (because it not empty)
    2. For row 3, I want PRD column should get value from PRD1

    I hope I have supplied sufficient information, please ask if you need to know more.
    EDIT:
    Asked same question @mr.excel.
    Last edited by fr0zenfyr; 11-27-2013 at 03:37 AM. Reason: Edit post

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: [VBA]: set cell equal to a cell in another column(same row) if empty

    Hi, fr0zenfyr,

    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...-if-empty.html

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: [VBA]: set cell equal to a cell in another column(same row) if empty

    Quote Originally Posted by HaHoBe View Post
    Hi, fr0zenfyr,

    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...-if-empty.html

    Ciao,
    Holger
    My bad @HaHoBe I was too ignorant to add a trackback on either sites because of the urgency I'm in, this is embarrassing. I have now edited and updated the post to reflect a link to my question at mrExcel.com. Also, I have added a linkback on the other forum[tried to do it here but nothing happened, so edited OP to mention it].

    Now, I hope I can expect to get some help. Sorry again for the trouble.

  4. #4
    Registered User
    Join Date
    10-15-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: [VBA]: set cell equal to a cell in another column(same row) if empty

    UPDATE: tried the solutionas suggested here but didn't work for me. The situation is more or less same.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: [VBA]: set cell equal to a cell in another column(same row) if empty

    Hi, fr0zenfyr,

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Holger

  6. #6
    Registered User
    Join Date
    10-15-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: [VBA]: set cell equal to a cell in another column(same row) if empty

    @Holger: All hail. Works perfectly. Can't thank.

+ 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] if workbook inactive for 30sec make last empty cell in column b the active cell
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-30-2013, 09:01 PM
  2. [SOLVED] If A Cell Is NOT Equal to a list of values OR Empty
    By DebbieEdwards in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2013, 10:41 AM
  3. [SOLVED] Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2
    By killerthun in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-16-2012, 01:21 PM
  4. Copy values from cell in active row, paste in first empty cell in spesified column.
    By Test123Test in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2012, 05:20 PM
  5. Blank (empty) cell always equal to 0??
    By ulfah in forum Excel General
    Replies: 3
    Last Post: 02-01-2006, 01:00 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