{"id":4899,"date":"2023-07-06T16:46:32","date_gmt":"2023-07-06T16:46:32","guid":{"rendered":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/"},"modified":"2023-07-06T16:46:32","modified_gmt":"2023-07-06T16:46:32","slug":"formulario-vba1c1","status":"publish","type":"post","link":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/","title":{"rendered":"Como usar formular1c1 em vba (com exemplos)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Voc\u00ea pode usar a propriedade <strong>FormulaR1C1<\/strong> no VBA para criar uma refer\u00eancia absoluta ou relativa a uma c\u00e9lula espec\u00edfica em uma planilha.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Existem duas maneiras comuns de usar essa propriedade:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>M\u00e9todo 1: Use a f\u00f3rmula R1C1 para criar uma refer\u00eancia absoluta<\/strong><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">Sub<\/span> MultipyCell()\n\nRange(\" <span style=\"color: #ff0000;\">C5<\/span> \").FormulaR1C1 = \" <span style=\"color: #ff0000;\">=R1C1*20<\/span> \"\n\n<span style=\"color: #0000ff;\">End Sub\n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Quando voc\u00ea executa esta macro espec\u00edfica, a c\u00e9lula <strong>C5<\/strong> exibir\u00e1 o resultado da c\u00e9lula na <strong>linha 1<\/strong> e <strong>na coluna 1<\/strong> multiplicado por 20.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>M\u00e9todo 2: Use a f\u00f3rmula R1C1 para fazer uma refer\u00eancia relativa<\/strong><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">Sub<\/span> MultipyCell()\n\nRange(\" <span style=\"color: #ff0000;\">C5<\/span> \").FormulaR1C1 = \" <span style=\"color: #ff0000;\">=R[-4]C[-2]*20<\/span> \"\n\n<span style=\"color: #0000ff;\">End Sub\n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Quando voc\u00ea executa esta macro espec\u00edfica, a c\u00e9lula <strong>C5<\/strong> exibir\u00e1 o resultado da c\u00e9lula <strong>4 linhas acima<\/strong> e <strong>2 colunas \u00e0 sua esquerda<\/strong> multiplicado por 20.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Os exemplos a seguir mostram como usar cada m\u00e9todo na pr\u00e1tica com uma planilha Excel contendo o valor <b>10<\/b> na c\u00e9lula <strong>A1<\/strong> :<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-38252 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/r1.png\" alt=\"\" width=\"488\" height=\"366\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Exemplo 1: Use a f\u00f3rmula R1C1 para criar uma refer\u00eancia absoluta<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Podemos criar a seguinte macro para multiplicar o valor da c\u00e9lula na <strong>linha 1<\/strong> e <strong>coluna 1<\/strong> por 20 e exibir os resultados na c\u00e9lula <strong>C5<\/strong> :<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">Sub<\/span> MultipyCell()\n\nRange(\" <span style=\"color: #ff0000;\">C5<\/span> \").FormulaR1C1 = \" <span style=\"color: #ff0000;\">=R1C1*20<\/span> \"\n\n<span style=\"color: #0000ff;\">End Sub<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Quando executamos esta macro, recebemos a seguinte sa\u00edda:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-38254 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/r2.png\" alt=\"\" width=\"486\" height=\"385\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Podemos ver que o Excel usou a f\u00f3rmula <strong>=$A$1*20<\/strong> para calcular o resultado na c\u00e9lula <strong>C5<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Como usamos <strong>R1C1<\/strong> em nossa f\u00f3rmula em VBA, fizemos uma refer\u00eancia absoluta \u00e0 c\u00e9lula na primeira linha e na primeira coluna, que \u00e9 a c\u00e9lula <strong>A1<\/strong> .<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Exemplo 2: Use a f\u00f3rmula R1C1 para fazer uma refer\u00eancia relativa<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Podemos criar a seguinte macro para multiplicar o valor da c\u00e9lula que est\u00e1 <strong>4 linhas acima<\/strong> e <strong>2 colunas \u00e0 esquerda<\/strong> da c\u00e9lula <strong>C5<\/strong> por 20 e exibir os resultados na c\u00e9lula <strong>C5<\/strong> :<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #0000ff;\">Sub<\/span> MultipyCell()\n\nRange(\" <span style=\"color: #ff0000;\">C5<\/span> \").FormulaR1C1 = \" <span style=\"color: #ff0000;\">=R[-4]C[-2]*20<\/span> \"\n\n<span style=\"color: #0000ff;\">End Sub\n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Quando executamos esta macro, recebemos a seguinte sa\u00edda:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-38255 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/r3.png\" alt=\"\" width=\"455\" height=\"377\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Podemos ver que o Excel usou a f\u00f3rmula <strong>=A1*20<\/strong> para calcular o resultado na c\u00e9lula <strong>C5<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\">Como usamos par\u00eanteses com <strong>R[-4]C[-2]<\/strong> em nossa f\u00f3rmula em VBA, fizemos uma refer\u00eancia relativa \u00e0 c\u00e9lula localizada 4 linhas acima e 2 colunas \u00e0 esquerda da c\u00e9lula <strong>C5<\/strong> , que \u00e9 a c\u00e9lula <strong>A1<\/strong> .<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Nota<\/strong> : Voc\u00ea pode encontrar a documenta\u00e7\u00e3o completa da propriedade VBA <b>FormulaR1C1<\/b> <a href=\"https:\/\/learn.microsoft.com\/en-us\/office\/vba\/api\/excel.range.formular1c1\" target=\"_blank\" rel=\"noopener\">aqui<\/a> .<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Recursos adicionais<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">Os tutoriais a seguir explicam como realizar outras tarefas comuns em VBA:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/pt\/vba-se-a-celula-contiver\/\" target=\"_blank\" rel=\"noopener\">VBA: uma f\u00f3rmula simples para \u201cSe a c\u00e9lula contiver\u201d<\/a><br \/> <a href=\"https:\/\/statorials.org\/pt\/vba-conta-ocorrencias-de-caracteres-em-string\/\" target=\"_blank\" rel=\"noopener\">VBA: Como contar ocorr\u00eancias de caracteres em uma string<\/a><br \/> <a href=\"https:\/\/statorials.org\/pt\/vba-contem-string\/\" target=\"_blank\" rel=\"noopener\">VBA: como verificar se uma string cont\u00e9m outra string<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Voc\u00ea pode usar a propriedade FormulaR1C1 no VBA para criar uma refer\u00eancia absoluta ou relativa a uma c\u00e9lula espec\u00edfica em uma planilha. Existem duas maneiras comuns de usar essa propriedade: M\u00e9todo 1: Use a f\u00f3rmula R1C1 para criar uma refer\u00eancia absoluta Sub MultipyCell() Range(&#8221; C5 &#8220;).FormulaR1C1 = &#8221; =R1C1*20 &#8221; End Sub Quando voc\u00ea executa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-4899","post","type-post","status-publish","format-standard","hentry","category-guia"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Como usar FormulaR1C1 em VBA (com exemplos) \u2013 Statorials<\/title>\n<meta name=\"description\" content=\"Este tutorial explica como usar FormulaR1C1 em VBA para criar refer\u00eancias de c\u00e9lulas, com v\u00e1rios exemplos.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/pt\/formulario-vba1c1\/\" \/>\n<meta property=\"og:locale\" content=\"pt_PT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Como usar FormulaR1C1 em VBA (com exemplos) \u2013 Statorials\" \/>\n<meta property=\"og:description\" content=\"Este tutorial explica como usar FormulaR1C1 em VBA para criar refer\u00eancias de c\u00e9lulas, com v\u00e1rios exemplos.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/pt\/formulario-vba1c1\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-06T16:46:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/r1.png\" \/>\n<meta name=\"author\" content=\"Dr. benjamim anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr. benjamim anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo estimado de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/pt\/formulario-vba1c1\/\",\"url\":\"https:\/\/statorials.org\/pt\/formulario-vba1c1\/\",\"name\":\"Como usar FormulaR1C1 em VBA (com exemplos) \u2013 Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/pt\/#website\"},\"datePublished\":\"2023-07-06T16:46:32+00:00\",\"dateModified\":\"2023-07-06T16:46:32+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666\"},\"description\":\"Este tutorial explica como usar FormulaR1C1 em VBA para criar refer\u00eancias de c\u00e9lulas, com v\u00e1rios exemplos.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/pt\/formulario-vba1c1\/#breadcrumb\"},\"inLanguage\":\"pt-PT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/pt\/formulario-vba1c1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/pt\/formulario-vba1c1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Lar\",\"item\":\"https:\/\/statorials.org\/pt\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Como usar formular1c1 em vba (com exemplos)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/pt\/#website\",\"url\":\"https:\/\/statorials.org\/pt\/\",\"name\":\"Statorials\",\"description\":\"O seu guia para a literacia estat\u00edstica!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/pt\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-PT\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666\",\"name\":\"Dr. benjamim anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-PT\",\"@id\":\"https:\/\/statorials.org\/pt\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr. benjamim anderson\"},\"description\":\"Ol\u00e1, sou Benjamin, um professor aposentado de estat\u00edstica que se tornou professor dedicado na Statorials. Com vasta experi\u00eancia e conhecimento na \u00e1rea de estat\u00edstica, estou empenhado em compartilhar meu conhecimento para capacitar os alunos por meio de Statorials. Saber mais\",\"sameAs\":[\"https:\/\/statorials.org\/pt\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Como usar FormulaR1C1 em VBA (com exemplos) \u2013 Statorials","description":"Este tutorial explica como usar FormulaR1C1 em VBA para criar refer\u00eancias de c\u00e9lulas, com v\u00e1rios exemplos.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/","og_locale":"pt_PT","og_type":"article","og_title":"Como usar FormulaR1C1 em VBA (com exemplos) \u2013 Statorials","og_description":"Este tutorial explica como usar FormulaR1C1 em VBA para criar refer\u00eancias de c\u00e9lulas, com v\u00e1rios exemplos.","og_url":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/","og_site_name":"Statorials","article_published_time":"2023-07-06T16:46:32+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/r1.png"}],"author":"Dr. benjamim anderson","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Dr. benjamim anderson","Tempo estimado de leitura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/","url":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/","name":"Como usar FormulaR1C1 em VBA (com exemplos) \u2013 Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/pt\/#website"},"datePublished":"2023-07-06T16:46:32+00:00","dateModified":"2023-07-06T16:46:32+00:00","author":{"@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666"},"description":"Este tutorial explica como usar FormulaR1C1 em VBA para criar refer\u00eancias de c\u00e9lulas, com v\u00e1rios exemplos.","breadcrumb":{"@id":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/#breadcrumb"},"inLanguage":"pt-PT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/pt\/formulario-vba1c1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/pt\/formulario-vba1c1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Lar","item":"https:\/\/statorials.org\/pt\/"},{"@type":"ListItem","position":2,"name":"Como usar formular1c1 em vba (com exemplos)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/pt\/#website","url":"https:\/\/statorials.org\/pt\/","name":"Statorials","description":"O seu guia para a literacia estat\u00edstica!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/pt\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-PT"},{"@type":"Person","@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/e08f98e8db95e0aa9c310e1b27c9c666","name":"Dr. benjamim anderson","image":{"@type":"ImageObject","inLanguage":"pt-PT","@id":"https:\/\/statorials.org\/pt\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/pt\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr. benjamim anderson"},"description":"Ol\u00e1, sou Benjamin, um professor aposentado de estat\u00edstica que se tornou professor dedicado na Statorials. Com vasta experi\u00eancia e conhecimento na \u00e1rea de estat\u00edstica, estou empenhado em compartilhar meu conhecimento para capacitar os alunos por meio de Statorials. Saber mais","sameAs":["https:\/\/statorials.org\/pt"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts\/4899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/comments?post=4899"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/posts\/4899\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/media?parent=4899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/categories?post=4899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/pt\/wp-json\/wp\/v2\/tags?post=4899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}