+ Reply to Thread
Results 1 to 3 of 3

Pasting value for a Row if coloumn A has a certain value

  1. #1
    Registered User
    Join Date
    03-03-2019
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    17

    Pasting value for a Row if coloumn A has a certain value

    Hey all!

    I would like some help regarding a certain task I want to automate. I understand this task will require vba macros. Essentially, the idea is if coloumn A has "#", that row will be copy pasted. Lets say cell A3 has a "#", therefore cell b3:z3 will be pasted value.

    I dont really have much knowledge in vba so with what I understood about it, ive been able to return the first cell with "#" in vba, and then using a count function to return the number of "#" in vba ( rest assured that there wont be any gaps between the hashtags). My approach was that with the first output which gives a result of $A$3 and second outputs which result in a count of 5, I could combine the two to result in a range of A3:A8. And then use that output to select range B3:Z8 and paste that as value. But other than the first and second output, I couldn't figure out to do the rest. If you guys have a more efficient method, will be much appreciated.

    Please also note that .Cells(.Rows.Count, "A").End(xlUp).Row wont really work. The output of "#" in coloumn a will be result of a formula, which will with result in # or "". As I understand, that method selects even the null string outputs.
    Attached Files Attached Files
    Last edited by kohno71; 11-11-2020 at 01:56 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Pasting value for a Row if coloumn A has a certain value

    Please read the yellow banner at the top of this page on how to attach a file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-03-2019
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Pasting value for a Row if coloumn A has a certain value

    I figured it out, heres the code for people who have the same problem~

    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. [SOLVED] Macro Help: Sum values in coloumn B falling between Text1 and Text2 in coloumn A
    By excel_novice2019 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2019, 09:53 PM
  2. Vlookup returning first row coloumn data and not comparing rest of coloumn
    By Brapp2Smokin in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-26-2018, 08:24 PM
  3. [SOLVED] add formula to the coloumn
    By raj00 in forum Excel Formulas & Functions
    Replies: 33
    Last Post: 06-23-2016, 07:36 AM
  4. [SOLVED] Count each unique value in coloumn 'a' and sum values in coloumn 'b'
    By vipin717 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-06-2014, 05:25 AM
  5. [SOLVED] i need a blank coloumn next
    By anilg0001 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-15-2013, 02:26 AM
  6. Copying non zero value from one coloumn to another
    By gaju_3112 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-25-2007, 04:58 AM
  7. Regarding Coloumn heading
    By raul09 in forum Excel General
    Replies: 1
    Last Post: 01-04-2007, 09:02 AM

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