Looking for vba or formula help

azrcguy

New Member
Joined
Nov 15, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello all been searching for a while now and cant find what I'm looking for. Still new and trying to teach myself to write vba codes

I'm trying to loop through the J column on my sheet (which changes size due to inserting rows) and looks for the word "install" if it finds it, grab the number that is in the C column and perform a small formula (value in C *20/60) and put that result in the K column.

any help on this would be greatly appreciated


1731698079823.png
1731698079823.png
 
Given that and assuming the values in column J are not the result of formulas, try this with a copy of your workbook.
This does not test every row in the range, just those that have something in column J. So in my sample sheet below, only 3 tests needed.

VBA Code:
Sub Test()
  Dim c As Range
 
  For Each c In Range("J14", Range("J" & Rows.Count).End(xlUp)).SpecialCells(xlConstants)
    If UCase(c.Value) = "INSTALL" Then c.Offset(, 1).MergeArea.Cells(1).Value = c.Offset(, -7).MergeArea.Cells(1).Value / 3
  Next c
End Sub

Here is my test sheet after running the code on a sheet with different sized merged areas.

azrcguy.xlsm
BCJK
1451.666667
15DATAINSTALL
16
172
18
19
20DATADROP
21
2210.333333
23DATAINSTALL
24
25
Install

This works great. Thank you very much.
On a work pc and downloading anything is an act of congress but ill look into it
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This works great. Thank you very much.
You're welcome. Thanks for the confirmation. :)


On a work pc and downloading anything is an act of congress but ill look into it
If you are unable to use XL2BB then in any future questions it would be a good idea to state that in the first post so that we do not keep asking. 😎
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top