ctouchberry
New Member
- Joined
- Dec 4, 2017
- Messages
- 40
I'm not very familiar with the VBA part of Excel, more familiar with the normal in-cell formulas. I apologize in advance for technical errors.
I'm working on organizing a bunch of data from a few sheets onto one separate sheet (same workbook).
I have "Tag Value Names" and "Tag Values", such as CFM: 50. Right now, I have both of them pulling from one source sheet, to the target sheet. But I just have them going to a random row, and I need certain Values to go certain columns (and rows, later on). The Value for CFM needs to go in the column labeled CFM.
This pairing comes from the source sheet as Name (in one cell) and Value (in another cell). For this purpose, the Name does not need to be transferred to the target sheet, only the Value.
I guess my question really goes something like this. How do you write the VBA function for; If A cell has CFM in it, put B cell in C column on different sheet. Also, how to do you case-proof the function, so that it doesn't fail on a "cfm", "CFm", "CFM" difference.
The evolution of this function would be to have the B cell (CFM actual value) be lined up with the Tag Name itself (AHU-2 in this case). Since the tag value number is associated with the CFM of Air Handler 2.
https://i.stack.imgur.com/0DBkE.png
https://i.stack.imgur.com/MUawC.png
I'm working on organizing a bunch of data from a few sheets onto one separate sheet (same workbook).
I have "Tag Value Names" and "Tag Values", such as CFM: 50. Right now, I have both of them pulling from one source sheet, to the target sheet. But I just have them going to a random row, and I need certain Values to go certain columns (and rows, later on). The Value for CFM needs to go in the column labeled CFM.
This pairing comes from the source sheet as Name (in one cell) and Value (in another cell). For this purpose, the Name does not need to be transferred to the target sheet, only the Value.
I guess my question really goes something like this. How do you write the VBA function for; If A cell has CFM in it, put B cell in C column on different sheet. Also, how to do you case-proof the function, so that it doesn't fail on a "cfm", "CFm", "CFM" difference.
The evolution of this function would be to have the B cell (CFM actual value) be lined up with the Tag Name itself (AHU-2 in this case). Since the tag value number is associated with the CFM of Air Handler 2.
https://i.stack.imgur.com/0DBkE.png
https://i.stack.imgur.com/MUawC.png
Code:
With Sheets("08-Attribute")
' AHU 2 CFM Category
Sheets("JCX").Range("T2").Value = .Range("I3").Value
' AHU 2 CFM Value
Sheets("JCX").Range("U2").Value = .Range("K3").Value