hello,
I'm trying to extract the string or text inside a validation data list that is in cell H13 and copy or place the data in another workbook at the specified range. this is my code:
Option Explicit
Private Sub BotonCrearTxt()
Dim filepath As String
Dim name As ListBox
Dim sueldo As Integer
Dim wbpaladin As Workbook
Dim sheetpagos As Worksheet
Dim last_row_data As Variant
Set sheetpagos = Sheets("pagos")
sheetpagos.Select
name = Range("H13")<----------THIS RANGE IS A VALIDATION DATA LIST
sueldo = Range("J13")
Set wbpaladin = Workbooks.Open("C:\Users\Kevin Millan\Dropbox\PALADIN\INVENTARIO REPUESTOS.xlsm")
Sheets("GASTOS").Select
last_row_data = Sheets("GASTOS").Range("H60000").End(xlUp).Row
last_row_data = last_row_data
Sheets("GASTOS").Range("h" & last_row_data) = name
Sheets("GASTOS").Range("j" & last_row_data) = sueldo
end sub
ps: after that i'd like to add an amount of rows in my new otherworkbook table that would be equal to the amount of rows added from my previous workbook. (i know that for that I would have to make my ranges dynamic, which I can figure out).
thank you
I'm trying to extract the string or text inside a validation data list that is in cell H13 and copy or place the data in another workbook at the specified range. this is my code:
Option Explicit
Private Sub BotonCrearTxt()
Dim filepath As String
Dim name As ListBox
Dim sueldo As Integer
Dim wbpaladin As Workbook
Dim sheetpagos As Worksheet
Dim last_row_data As Variant
Set sheetpagos = Sheets("pagos")
sheetpagos.Select
name = Range("H13")<----------THIS RANGE IS A VALIDATION DATA LIST
sueldo = Range("J13")
Set wbpaladin = Workbooks.Open("C:\Users\Kevin Millan\Dropbox\PALADIN\INVENTARIO REPUESTOS.xlsm")
Sheets("GASTOS").Select
last_row_data = Sheets("GASTOS").Range("H60000").End(xlUp).Row
last_row_data = last_row_data
Sheets("GASTOS").Range("h" & last_row_data) = name
Sheets("GASTOS").Range("j" & last_row_data) = sueldo
end sub
ps: after that i'd like to add an amount of rows in my new otherworkbook table that would be equal to the amount of rows added from my previous workbook. (i know that for that I would have to make my ranges dynamic, which I can figure out).
thank you