Analisando de forma geral, o programa desenvolvido provou-se uma ótima alternativa
para auxiliar no gerenciamento de reservatórios de gás. Parte dos objetivos era ser uma opção
confiável e barata para empresas de pequeno porte, que operam em poços terrestres, sem o
capital necessário para adquirir softwares caros estabelecidos no mercado, e pode-se dizer que
foi atendido. Além disso, o programa também pode ajudar no aprendizado acadêmico de
engenharia de reservatórios, sendo uma ferramente de validação ou até de otimização, uma vez
que poderia ser aplicável para questões pontuais em outras disciplinas, como propriedade dos
fluidos.
Os resultados obtidos com o programa, que foram extremamente similares, quando não
exatamente iguais, às referências com que fora comparado, mostra que a ferramente é adequada
na determinação do influxo através dos modelos programados, na determinação do fator de
compressibilidade do gás e, principalmente naquilo que se faz objetivo principal do trabalho,
na determinação da previsão de reserva total do reservatório, podendo ser ajustada
recorrentemente ao passo que novos dados de produção são adquiridos, sendo viável inferir
mudanças no reservatório, como a descoberta de um aquífero adjacente que não se tinha
conhecimento.
Entretanto, não foi possível validar o modelo da determinação de reservas em
reservatórios com influxo, pela ausência de exemplos na literatura e dificuldade de se conseguir
dados para teste. Dito isto, não há razões para crer que o modelo falharia durante a verificação,
posto que, apesar de longe do ideal, o exemplo fictício mostrou uma estrutura interessante.
Desta maneira, o trabalho atingiu seus objetivos, dentro de suas limitações como uma
dissertação de graduação. Para uma próxima pesquisa relacionada ao tema, seria interessante a
criação de um banco de dados com modelos composicionais dos gases, a adição de novos
modelos de influxo de água, uma modelagem com as correlações para a compressibilidade da
água e da formação, que variam com a pressão e, por fim, uma expansão para outros tipos de
reservatórios de gás, citados no Capítulo 2, ou, numa abordagem mais completa, incluir
reservatórios de óleo.
REFERÊNCIAS BIBLIOGRÁFICAS
AHMED, Tarek. Reservoir Engineering Handbook. 3ª Edição. Burlington, TX: Gulf
Professional Publishing, 2006. 1359 p.
AHMED, Tarek. Equations of State and PVT Analysis: Applications for Improved Reservoir
Modeling. Houston, TX: Gulf Publishing Company, 2007. 549 p.
AHMED, Tarek; MEEHAN, D. Nathan. Advanced Reservoir Management and Engineering.
2ª Edição. Waltham, TX: Gulf Professional Publishing, 2012. 702 p.
AHÓN, Victor R. R.; Notas de Aula da Disciplina TEQ-160: Propriedades de Fluidos de
Petróleo. Apostila do Curso de Propriedades de Fluidos de Petróleo da UFF, 2017.
BASÍLIO, Lorran Santos. Ferramentas Numérico-Computacionais para Análise do
Comportamento de Reservatórios de Petróleo. Niterói, 2012. 79f. Trabalho de Conclusão de
Curso (Graduação em Engenharia de Petróleo) – Curso de Engenharia de Petróleo –
Departamento de Engenharia Química e de Petróleo, Universidade Federal Fluminense, Niterói,
2012.
BP.
BP
Statistical
Review
of
World
Energy
2017.
Disponível
em:
<https://www.bp.com/content/dam/bp/en/corporate/pdf/energy-economics/statistical-review-
2017/bp-statistical-review-of-world-energy-2017-full-report.pdf>. Acessado em 10 de maio de
2018.
BROWN, et al. Natural Gasoline and the Volatile Hydrocarbons. Tulsa: NGAA, 1948. 92 p.
Disponível
em:
<
https://babel.hathitrust.org/cgi/pt?id=mdp.39015002087339;view=1up;seq=3>. Acesso em: 10
de maio de 2018
CRAFT, B. C.; HAWKINS, M. F. Applied Petroleum Reservoir Engineering. Englewood
Cliffs, NJ: Prentice-Hall, Inc., 1959. 437 p.
DRANCHUK, P.M.; ABOU-KASSEM, J.H., 1975. Calculation of Z Factors for Natural
Gases, Using Equations of State. Journal Canadian Petroleum Technology, Vol. 14, 3, Julho,
1975, p. 34-36.
ENGINEERING UNITS. Determine Compressibility factor, Z Factor. Disponível em:
<http://engineeringunits.com/compressibility-factor-z-factor/>. Acessado em 17 de novembro
de 2018.
EZEKEW, N. Petroleum Reservoir Engineering Practice. Boston, MA: Prentice Hall, 2011.
770 p.
ALVES, Farley de Freitas. Estimativa de Propriedades de Reservatórios de Gás Natural
Relevantes às Análises de Viabilidade Econômica. Niterói, 2010. 82f. Trabalho de Conclusão
de Curso (Graduação em Engenharia de Petróleo) – Curso de Engenharia de Petróleo –
Departamento de Engenharia Química e de Petróleo, Universidade Federal Fluminense, Niterói,
2010.
LAKE, Larry W.; HOLSTEIN, Edward D. Petroleum Engineer Handbook, Vol. 5 – Reservoir
Engineering and Petrophysics. Richardson, TX: Society of Petroleum Engineers, 2007.
1640 p.
MATTHEWS C. S.; RUSSEL D. G. Pressure Buildup and Flow Tests in Wells. Dallas, TX:
Society of Petroleum Engineers of AIME, 1967. 163 p.
McCAIN, W. D. The Properties of Petroleum Fluids. 2ª Edição. Tulsa, Oklahoma: PennWell
Publishing Company, 1999. 548 p.
QUEIROZ GALVÃO EXPLORAÇÃO E PRODUÇÃO. Tipos de Reservatórios. Disponível
em: <http://www.qgep.com.br/static/ptb/tipos-de-reservatorio.asp?idioma=ptb>. Acessado em
05 de junho de 2018.
ROSA, Adalberto José; CARVALHO, Renato de Souza; XAVIER, José Augusto Daniel.
Engenharia de Reservatórios de Petróleo. Rio de Janeiro: Interciência Ltda., 2006. 808 p.
TESTWELLS. Radius of Investigation. Disponível em: <https://www.testwells.com/radius-of-
investigation/>. Acessado em 05 de junho de 2018.
WICHERT, E; AZIZ, K. 1972. Calculate Z's for Sour Gases. Hydrocarbon Processing 51
(Maio), 1972, p. 119–122.
YARBOROUGH, L; HALL, K.R. How to Solve Equation of State for Z-Factors. Oil and Gas
Journal, 1974, p.86-88.
APÊNDICE A – CÓDIGOS VBA
Neste apêndice, serão dispostos todos os códigos VBA que estão inseridos dentro do
programa, divididos por planilha e organizados por botão.
Botões que compõem todas as planilhas serão dispostos separadamente no início, com
seu código sendo igual em todas as vezes que aparece. Botões que possuem o mesmo nome
mas códigos diferentes serão apresentados na parte destinada para sua aba.
Adicionalmente, os códigos serão apresentados em sua formatação original do VBA,
tanto em cores, fonte, tamanho e posição, para que facilite o entendimento. E, quando um
código continuar em mais de uma linha de word, ele precisa estar na mesma linha no VBA, a
não ser que contenha um underline “_”, caracter que indica continuação na linha seguinte.
BOTÕES COMPARTILHADOS
Private Sub Home_Click()
' Leva para a Aba 'Home'
Sheets("Home").Select
End Sub
Private Sub ConvUni_Click()
' Leva para a Aba 'Conversores de Unidade'
Sheets("Conversores de unidade").Select
End Sub
Private Sub Dados_Click()
' Leva para a Aba 'Dados'
Sheets("Dados").Select
Home
Dados
End Sub
Private Sub Inf_Click()
' Leva para a Aba 'Influxo'
Sheets("Influxo").Select
End Sub
Private Sub Result1_Click()
' Leva para a Aba 'Resultados1'
Sheets("Resultados1").Select
End Sub
Private Sub Result2_Click()
' Leva para a Aba 'Resultados2'
Sheets("Resultados2").Select
End Sub
Private Sub Result3_Click()
' Leva para a Aba 'Resultados3'
Sheets("Resultados3").Select
End Sub
CONVERSORES DE UNIDADE
Private Sub Aplic_Click()
Influxo de Água
Resultados - Pressão Normal
Resultados - P. Anormais
Resultados - Influxo
'Tira a proteção da pasta para pode rodar o código
ThisWorkbook.Worksheets("Conversores de Unidade").Unprotect ("manf")
'Definir variável usada Dim i As Integer
'Valor inicial da variável
i = 1
'Retira atualização automática de tela para execução do código
Application.ScreenUpdating = False
'Condicional de que a quantidade de dados a serem inseridos foi apresentada If Cells(9, 11).Value > 0 Then
'Cria a numeração da tabela onde serão inseridos os valores para conversão
Do Until i = Cells(9, 11).Value + 1 Cells(13 + i, 9) = i
i = i + 1 Loop
'Apaga os valores abaixo do número indicado de conversão
Range(Cells(13 + i, 9), Cells(1048576, 11)).Value = ""
If Cells(9, 11).Value > 1 Then
'Cria a tabela organizada para inserção dos dados
Range(Cells(12 + i, 9), Cells(12 + i, 11)).Select Range(Selection, Selection.End(xlUp)).Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0
.TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorDark2 .TintAndShade = 0 .PatternTintAndShade = 0 End With Range("I12:K13").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlMedium End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0
.Weight = xlMedium End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlMedium End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlMedium End With
Range(Cells(13 + i, 9), Cells(13 + i, 11)).Select Range(Selection, Selection.End(xlDown)).Select With Selection.Interior .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 .PatternTintAndShade = 0 End With Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone Selection.Borders(xlEdgeLeft).LineStyle = xlNone Selection.Borders(xlEdgeTop).LineStyle = xlNone Selection.Borders(xlEdgeBottom).LineStyle = xlNone Selection.Borders(xlEdgeRight).LineStyle = xlNone Selection.Borders(xlInsideVertical).LineStyle = xlNone Selection.Borders(xlInsideHorizontal).LineStyle = xlNone Range(Cells(12 + i, 9), Cells(12 + i, 11)).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous
.ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Range("I14").Select Range(Selection, Selection.End(xlDown)).Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorAccent5 .TintAndShade = 0.399975585192419 .PatternTintAndShade = 0 End With Cells(6, 9).Select End If Else
'Pede que o nº de dados a serem inseridos seja informado, caso não o tenha sido, e apaga a tabela
Range(Cells(14, 9), Cells(1048576, 9)).Value = ""
MsgBox "Informe quantidade de dados do histórico a serem inseridos."
End If
'Reativa animações na planilha
Application.ScreenUpdating = True 'Reativa proteção da planilha
ThisWorkbook.Worksheets("Conversores de Unidade").Protect ("manf")
End Sub
Private Sub Conver1_Change()
'Ao modificar o parâmetros de conversão, o valor das ComboBox com 'as unidades de origem e desejadas é apagado.
Application.ScreenUpdating = False
Conver2 = "" Conver3 = ""
Application.ScreenUpdating = True End Sub
Private Sub Conver2_GotFocus()
'Ao abrir a ComboBox da unidade de origem da conversão, são
'instantaneamente inseridas as unidades disponíveis de acordo com 'a ComboBox que define o parâmetro a ser convertido
If Conver1 = "Pressão" Then
With Conver2 .AddItem "kgf/cm²" .AddItem "kPa" .AddItem "PSI" .AddItem "atm" .ListRows = 4 End With
ElseIf Conver1 = "Volume" Then
With Conver2
.AddItem "Metro cúbico (m³)"
Selecione Parâmetro
.AddItem "Barril (bbl)"
.AddItem "Polegada cúbica (in³)" .AddItem "Pé cúbico (ft³)"
.AddItem "Litro (l)"
.AddItem "Galão Americano" .ListRows = 6
End With
ElseIf Conver1 = "Temperatura" Then
With Conver2
.AddItem "Celsius (ºC)" .AddItem "Fahrenheit (ºF)" .AddItem "Rankine (R)" .AddItem "Kelvin (K)" .ListRows = 4
End With
ElseIf Conver1 = "Compressibilidade" Then
With Conver2 .AddItem "(kgf/cm²)¯¹" .AddItem "(kPa)¯¹" .AddItem "(PSI)¯¹" .AddItem "(atm)¯¹" .ListRows = 4 End With
ElseIf Conver1 = "Permeabilidade" Then
With Conver2 .AddItem "Milidarcy (md)" .AddItem "Darcy" .AddItem "m²" .AddItem "cm²" .ListRows = 4 End With
ElseIf Conver1 = "Viscosidade" Then
With Conver2
.AddItem "Centipoise (cp)"
.AddItem "Pascal-segundo (Pa.s)" .AddItem "dina.s/cm²"
End With End If
End Sub
Private Sub Conver2_LostFocus() Application.ScreenUpdating = False Dim v As String
'Ao tirar o foco da ComboBox com a unidade de origem, todo seu conteudo 'é esvaziado, e o valor selecionado (mantido na variável v) é reposto.
v = Conver2 With Conver2 .Clear End With Conver2 = v Application.ScreenUpdating = True End Sub
Private Sub Conver3_GotFocus()
'Ao abrir a ComboBox da unidade final da conversão, são
'instantaneamente inseridas as unidades disponíveis de acordo com 'a ComboBox que define o parâmetro a ser convertido
If Conver1 = "Pressão" Then
With Conver3 .AddItem "kgf/cm²" .AddItem "kPa" .AddItem "PSI" .AddItem "atm" .ListRows = 4 End With
ElseIf Conver1 = "Volume" Then
With Conver3
.AddItem "Metro cúbico (m³)" .AddItem "Barril (bbl)"
.AddItem "Polegada cúbica (in³)" .AddItem "Pé cúbico (ft³)"
.AddItem "Litro (l)"
PSI
.AddItem "Galão Americano" .ListRows = 6
End With
ElseIf Conver1 = "Temperatura" Then
With Conver3
.AddItem "Celsius (ºC)" .AddItem "Fahrenheit (ºF)" .AddItem "Rankine (R)" .AddItem "Kelvin (K)" .ListRows = 4
End With
ElseIf Conver1 = "Compressibilidade" Then
With Conver3 .AddItem "(kgf/cm²)¯¹" .AddItem "(kPa)¯¹" .AddItem "(PSI)¯¹" .AddItem "(atm)¯¹" .ListRows = 4 End With
ElseIf Conver1 = "Permeabilidade" Then
With Conver3 .AddItem "Milidarcy (md)" .AddItem "Darcy" .AddItem "m²" .AddItem "cm²" .ListRows = 4 End With
ElseIf Conver1 = "Viscosidade" Then
With Conver3
.AddItem "Centipoise (cp)"
.AddItem "Pascal-segundo (Pa.s)" .AddItem "dina.s/cm²"
.ListRows = 3 End With
End If End Sub
Private Sub Conver3_LostFocus() Application.ScreenUpdating = False
Dim v As String
'Ao tirar o foco da ComboBox com a unidade destino, todo seu conteudo 'é esvaziado, e o valor selecionado (mantido na variável v) é reposto.
v = Conver3 With Conver3 .Clear End With Conver3 = v Application.ScreenUpdating = True End Sub
Private Sub CalcUni_Click()
'Calcula a conversão dos dados inseridos na coluna J para
'a coluna K, de acordo com o escolhido nas ComboBox.
Dim i As Integer
Application.ScreenUpdating = False
'Caso o número de dados para criação da tabela não tenha sido inserido, 'manda uma mensagem para que coloque, e encerra o código.
If Cells(9, 11).Value <= 0 Then
MsgBox "Insira quantidade de dados a serem convertidas" GoTo Fim
Else
'Caso não tenha sido selecionado um parâmetro para conversão, 'solicita que o mesmo seja adicionado
If Conver1 = "Selecione Parâmetro" Then
MsgBox "Insira o parâmetro a ser convertido. Posteriormente, Insira as
unidades de origem e final." GoTo Fim
End If
'Caso as unidades de origem e destino não tenham sido inseridos, 'solicita que as mesmas sejam adicionadas
If Conver2 = "" Or Conver3 = "" Then
MsgBox "Insira as unidades originais e finais para cálculo." GoTo Fim
End If
i = 1
'Sequência de condicionais chamadas para rodar as fórmulas de conversão de acordo
'com o parâmetros das variáveis a serem convertidas e as unidades de origem de finais.
If Conver2 = "kgf/cm²" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "kPa" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 98.0665 ElseIf Conver3 = "PSI" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 14.22334 ElseIf Conver3 = "atm" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.9678411 ElseIf Conver3 = "kgf/cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "kPa" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "kgf/cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.01019716 ElseIf Conver3 = "PSI" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.1450377 ElseIf Conver3 = "atm" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.009869233 ElseIf Conver3 = "kPa" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "PSI" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "kgf/cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.0730695 ElseIf Conver3 = "kPa" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 6.894757 ElseIf Conver3 = "atm" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.06804596 ElseIf Conver3 = "PSI" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "atm" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "kgf/cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 1.033227 ElseIf Conver3 = "kPa" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 101.325 ElseIf Conver3 = "PSI" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 14.69595 ElseIf Conver3 = "atm" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Celsius (ºC)" Then
Do Until i = Cells(9, 11).Value + 1
Cells(13 + i, 11) = (Cells(13 + i, 10).Value * 1.8) + 32 ElseIf Conver3 = "Rankine (R)" Then
Cells(13 + i, 11) = (Cells(13 + i, 10).Value + 273.15) * 1.8 ElseIf Conver3 = "Kelvin (K)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value + 273.15 ElseIf Conver3 = "Celsius (ºC)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Fahrenheit (ºF)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Celsius (ºC)" Then
Cells(13 + i, 11) = (Cells(13 + i, 10).Value - 32) / 1.8 ElseIf Conver3 = "Rankine (R)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value + 459.67 ElseIf Conver3 = "Kelvin (K)" Then
Cells(13 + i, 11) = (Cells(13 + i, 10).Value + 459.67) / 1.8 ElseIf Conver3 = "Fahrenheit (ºF)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Rankine (R)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Celsius (ºC)" Then
Cells(13 + i, 11) = (Cells(13 + i, 10).Value / 1.8) - 273.15 ElseIf Conver3 = "Fahrenheit (ºF)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value - 459.67 ElseIf Conver3 = "Kelvin (K)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value / 1.8 ElseIf Conver3 = "Rankine (R)" Then
End If
i = i + 1 Loop
ElseIf Conver2 = "Kelvin (K)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Celsius (ºC)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value - 273.15 ElseIf Conver3 = "Fahrenheit (ºF)" Then
Cells(13 + i, 11) = (Cells(13 + i, 10).Value * 1.8) - 459.67 ElseIf Conver3 = "Rankine (R)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 1.8 ElseIf Conver3 = "Kelvin (K)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Metro cúbico (m³)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Barril (bbl)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 6.28981 ElseIf Conver3 = "Polegada cúbica (in³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 61023.74 ElseIf Conver3 = "Pé cúbico (ft³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 35.31467 ElseIf Conver3 = "Litro (l)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 1000 ElseIf Conver3 = "Galão Americano" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 264.172 ElseIf Conver3 = "Metro cúbico (m³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Barril (bbl)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Metro cúbico (m³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.1589873 ElseIf Conver3 = "Polegada cúbica (in³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 9702.001 ElseIf Conver3 = "Pé cúbico (ft³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 5.614584 ElseIf Conver3 = "Litro (l)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 158.9873 ElseIf Conver3 = "Galão Americano" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 42 ElseIf Conver3 = "Barril (bbl)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Polegada cúbica (in³)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Metro cúbico (m³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (1.638706 * (10 ^ (-5)))
ElseIf Conver3 = "Barril (bbl)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (1.030715 * (10 ^ (-4)))
ElseIf Conver3 = "Pé cúbico (ft³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (5.787037 * (10 ^ (-4)))
ElseIf Conver3 = "Litro (l)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.01638706 ElseIf Conver3 = "Galão Americano" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 4.329004 * (10 ^ (-4))
ElseIf Conver3 = "Polegada cúbica (in³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Pé cúbico (ft³)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Metro cúbico (m³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.02831685 ElseIf Conver3 = "Barril (bbl)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.1781076 ElseIf Conver3 = "Polegada cúbica (in³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 1728 ElseIf Conver3 = "Litro (l)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 28.31685 ElseIf Conver3 = "Galão Americano" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 7.48052 ElseIf Conver3 = "Pé cúbico (ft³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Litro (l)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Metro cúbico (m³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.001 ElseIf Conver3 = "Barril (bbl)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 6.28981 * (10 ^ (- 4))
ElseIf Conver3 = "Polegada cúbica (in³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 61.02374 ElseIf Conver3 = "Pé cúbico (ft³)" Then
ElseIf Conver3 = "Galão Americano" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.264172 ElseIf Conver3 = "Litro (l)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Galão Americano" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Metro cúbico (m³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.003785412 ElseIf Conver3 = "Barril (bbl)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.02380952 ElseIf Conver3 = "Polegada cúbica (in³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 231 ElseIf Conver3 = "Pé cúbico (ft³)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.1336806 ElseIf Conver3 = "Litro (l)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 3.785412 ElseIf Conver3 = "Galão Americano" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "(kgf/cm²)¯¹" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "(kPa)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.01019716 ElseIf Conver3 = "(PSI)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.0730695 ElseIf Conver3 = "(atm)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 1.033227 ElseIf Conver3 = "(kgf/cm²)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "(kPa)¯¹" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "(kgf/cm²)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 98.0665 ElseIf Conver3 = "(PSI)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 6.894757 ElseIf Conver3 = "(atm)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 101.325 ElseIf Conver3 = "(kPa)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "(PSI)¯¹" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "(kgf/cm²)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 14.22334 ElseIf Conver3 = "(kPa)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.1450377 ElseIf Conver3 = "(atm)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 14.69595 ElseIf Conver3 = "(PSI)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "(kgf/cm²)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.9678411 ElseIf Conver3 = "(kPa)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.009869233 ElseIf Conver3 = "(PSI)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.06804596 ElseIf Conver3 = "(atm)¯¹" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Milidarcy (md)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Darcy" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (10 ^ (-3)) ElseIf Conver3 = "m²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (9.86923 * (10 ^ (-16)))
ElseIf Conver3 = "cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 9.86923 * (10 ^ (- 12))
ElseIf Conver3 = "Milidarcy (md)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Darcy" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Milidarcy (md)" Then
ElseIf Conver3 = "m²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (9.86923 * (10 ^ (-13)))
ElseIf Conver3 = "cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (9.86923 * (10 ^ (-9)))
ElseIf Conver3 = "Darcy" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "m²" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Milidarcy (md)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 101325 * (10 ^ 10) ElseIf Conver3 = "Darcy" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 101.325 * (10 ^ 10)
ElseIf Conver3 = "cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (10 ^ 4) ElseIf Conver3 = "m²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "cm²" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Milidarcy (md)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 101.325 * (10 ^ 9) ElseIf Conver3 = "Darcy" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 101.325 * (10 ^ 6) ElseIf Conver3 = "m²" Then
ElseIf Conver3 = "cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Centipoise (cp)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Pascal-segundo (Pa.s)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (10 ^ (-3)) ElseIf Conver3 = "dina.s/cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * (10 ^ (-2)) ElseIf Conver3 = "Centipoise (cp)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "Pascal-segundo (Pa.s)" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Centipoise (cp)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 1000 ElseIf Conver3 = "dina.s/cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 10 ElseIf Conver3 = "Pascal-segundo (Pa.s)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If
i = i + 1 Loop
ElseIf Conver2 = "dina.s/cm²" Then
Do Until i = Cells(9, 11).Value + 1
If Conver3 = "Centipoise (cp)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 100 ElseIf Conver3 = "Pascal-segundo (Pa.s)" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value * 0.1 ElseIf Conver3 = "dina.s/cm²" Then
Cells(13 + i, 11) = Cells(13 + i, 10).Value End If i = i + 1 Loop End If End If Application.ScreenUpdating = True Fim: End Sub
Private Sub ResetAll_Click()
ThisWorkbook.Worksheets("Conversores de Unidade").Unprotect ("manf")
'Pergunta se o usuário tem certeza que quer resetar os dados da planilha 'E então reseta todas as celulas alteráveis para o estado original
Dim resultado As VbMsgBoxResult
resultado = MsgBox("Tem certeza que deseja resetar todos os dados?", vbYesNo, "Tomando uma decisão")
Application.ScreenUpdating = False 'Reseta todos os valores do programa
If resultado = vbYes Then
Cells(11, 2).Value = "" Cells(12, 3).Value = "" Cells(13, 4).Value = "" Cells(14, 5).Value = "" Cells(19, 2).Value = "" Cells(20, 3).Value = "" Cells(21, 4).Value = "" Cells(22, 5).Value = "" Cells(27, 2).Value = "" Cells(28, 3).Value = "" Cells(29, 4).Value = "" Resetar
Cells(30, 5).Value = "" Cells(31, 6).Value = "" Cells(32, 7).Value = "" Cells(37, 2).Value = "" Cells(38, 3).Value = "" Cells(39, 4).Value = "" Cells(40, 5).Value = "" Cells(9, 11).Value = "" Cells(45, 2).Value = "" Cells(46, 3).Value = ""