This might be a very simple question but I've been googling and playing around in Excel for a while now, unable to find a solution.
I have a spreadsheet with values in column G. If this value is over 1, I would like to mark various columns for the next x rows, x being the value in column G. I have basic programming knowledge and I have thought of multiple ways to do this through any number of programming languages but I can't find a way to implement this in Excel.
Any suggestions?
Something like this?
Sub Test() Dim cell As Range For Each cell In Range("G1:G100") If cell > 1 Then cell.Offset(0, 1) = "X" Next cell End Sub
To thank someone who has helped you, click on the star icon below their name.
I hate reading
Portfolio
I need a job.I am young and incompetent
I'm sorry, I should have mentioned that I have very little experience with Excel. Where do I go to enter that?
Thanks for the response, that looks very promising.
In your Excel spreadsheet, Hit ALT + F11, On the top you'll see Insert option, from there click Module. In the module window copy and paste the code, and you can run the macro by pressing F5
To thank someone who has helped you, click on the star icon below their name.
I hate reading
Portfolio
I need a job.I am young and incompetent
Thanks for the help. I believe I could modify this to suit my needs but will this need to be run every time new data is entered? This isn't for personal use and while I could try to explain it to the user, I do not know if it is the best solution.
Again, I don't have much experience with Excel, so it may be the only solution.
You can create a button using shape, and just assigned the macro to the button.
To thank someone who has helped you, click on the star icon below their name.
I hate reading
Portfolio
I need a job.I am young and incompetent
silly me. I didn't read your question carefully. In H1 copy and paste this and drag it down
=IF(G1>1,"X","")
To thank someone who has helped you, click on the star icon below their name.
I hate reading
Portfolio
I need a job.I am young and incompetent
Haha, I tried all sorts of things with if statements and while yours doesn't do what I want it sparked something in my head and I think I know how to do what I want. Thanks for all of your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks