+ Reply to Thread
Results 1 to 6 of 6

Macro to restrict to paste the data on all blank cells in column A

  1. #1
    Registered User
    Join Date
    09-10-2014
    Location
    India
    MS-Off Ver
    10
    Posts
    44

    Macro to restrict to paste the data on all blank cells in column A

    Hello All,

    I have a macro which is copying data from B3:B8 and pasting it in the blank cells of Column B.
    It is helpful the only problem is that it is pasting data to all blank cells in Column B.

    Need your help to restrict the pasting of data in blank cells off Column B adjacent A column.

    Code:
    Range("b3:b8").Copy

    Dim ws As Worksheet
    Set ws = ActiveSheet

    For Each cell In ws.Columns(2).Cells
    If IsEmpty(cell) = True Then cell.PasteSpecial:
    Next cell

    regards,
    Shan

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Macro to restrict to paste the data on all blank cells in column A

    Maybe (Code Untested)

    Please Login or Register  to view this content.
    P.S. - Not sure how you are copying 5 Cells and Pasting in 1 cell below another..
    Last edited by NeedForExcel; 02-03-2016 at 08:14 AM.
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    09-10-2014
    Location
    India
    MS-Off Ver
    10
    Posts
    44

    Re: Macro to restrict to paste the data on all blank cells in column A

    Thank you for your quick reply..

    I am getting below error while using this code..

    "Object Required"


    Regards,
    Shan

  4. #4
    Registered User
    Join Date
    09-10-2014
    Location
    India
    MS-Off Ver
    10
    Posts
    44

    Re: Macro to restrict to paste the data on all blank cells in column A

    Thank you Sir... The below code given by you is working as desired. Thank you so much.
    But I am unable to see the code you have provided here. I have received a email in that code is available.

    Dim ws As Worksheet, LR As Integer
    Set ws = ActiveSheet

    LR = ws.Cells(Rows.Count, 1).End(xlUp).Row

    For Each cell In ws.Range(Cells(1, 2), Cells(LR, 2))
    If IsEmpty(cell) = True Then cell.PasteSpecial
    Next cell

    Thank you so much
    Have a Nice Day !!!

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Macro to restrict to paste the data on all blank cells in column A

    Hi,

    Not sure what is causing the issue..

    However, I'll re-paste the code again

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-10-2014
    Location
    India
    MS-Off Ver
    10
    Posts
    44

    Re: Macro to restrict to paste the data on all blank cells in column A

    Thank you Sir..
    I am able to view old code only..

    I think there is some problem.

    Anyway I have received the updated code over my email .... and Its working fine..

    Even if you not paste it again here it is ok...

    I am tagging this thread as Solved!!!

    Thank you so much

+ 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] Need VBA Macro to Copy and paste column data in blank rows and repeat through spreadsheet
    By slk1186 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-07-2014, 12:50 PM
  2. [SOLVED] Macro to fill blank cells in column A based on non-blank cells
    By ktalamantez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 02:47 PM
  3. [SOLVED] Macro to copy columns and paste into one column in next blank column
    By rmmohan in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-31-2013, 03:14 PM
  4. Looking to create a macro that will skip blank cells in a column, find data cells
    By crayzwalz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2013, 09:01 AM
  5. Copy Data from Column and Paste to Next Blank Column on 2nd Sheet
    By adammark in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2010, 11:15 AM
  6. Using a Macro to paste into Blank Cells
    By phillipsb in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-05-2005, 01:05 PM
  7. Replies: 8
    Last Post: 02-14-2005, 11:06 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