אברהם דוד האט געשריבן:איך וויל מאכן א אפציע אין א User Form צו קענען זוכן פאר א רעקארד דורך אריינטייפן אין א Search Box איך בין זייער רוי אין VBA אבער אין א Worksheet האב איך געטראפן א וועג דאס צו מאכן, און דערווייל האב איך אויסגעשטעלט אין די Form אז דורך א Command Button עפענט ער יענע Sheet און דורך א מעקרא אין די Sheet עפענט ער צוריק די Form און ער לייגט אריין דארט די אויסגעוועלטע רעקארד. איך לייג דא צו א סעמפל פייל פון וואס איך האב געמאכט אז מען זאל בעסער פארשטיין (אין די ארגינעלע פייל איז עס שענער אויסגעשטעלט און באהאלטן אלע איבעריגע אינפארמעשאן וואס די User דארף נישט זען).
איך זוך א וועג צו מאכן די גאנצע זאך אין מיין User Form, אדער צום ווייניגסטענס זאל די Search געטון ווערן אין א אנדערע Form אנשטאט אין א Worksheet.
אויב איינער קען העלפן וועל איך זייער דאנקבאר זיין, איך האב פראבירט פרעגן אין Google אבער אזוי ווי איך קען נישט עכט קיין VBA פארשטיי איך בכלל נישט די ענטפערס. די בעסטע וועט זיין אויב איינער קען עס צולייגן אין דעם זעלבן פייל וואס איך לייג דא מיט, אזוי וועל איך לכאורה עס קענען איבערמאכן אין די עכטע פייל.
די פילסט אן row a בעיסד אויף row a ? אדער די האסט אינפארמאציע און די צווייטע קאלום און פאר אלע שורות וואס האבן דארט אינפארמאציע ווילסטו אז דער ערשטע שורה זאל האבן א נומבער ?
Sub Paste_Formulas()
Sheets("Formulas").Select
Range("A4").Copy
Sheets("TT Invoices").Select
Range("l2").Select
ActiveSheet.Paste
ActiveCell.Value = Right(ActiveCell.Value, Len(ActiveCell.Value) - 1)
ActiveCell.Copy
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Range(ActiveCell, ActiveCell.Offset(lastrow, 0).Offset(-2)).Select
ActiveSheet.Paste
ActiveSheet.Calculate
End Sub
I would also like to get rid of the direct reference [Range("A4").Copy].
On the Formulas sheet I would have a list of cell addresses needing to paste formulas and their relative formula would be placed in a cell next to it.
Then have the code automatically look on the Formulas sheet what needs to be pasted to which cell.
(Am I looking for too much?)
I can show a screenshot of what I mean.
Sub Paste_Formulas()
Sheets("Formulas").Select
Range("A4").Copy
Sheets("TT Invoices").Select
Range("l2").Select
ActiveSheet.Paste
ActiveCell.Value = Right(ActiveCell.Value, Len(ActiveCell.Value) - 1)
ActiveCell.Copy
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
Range(ActiveCell, ActiveCell.Offset(lastrow, 0).Offset(-2)).Select
ActiveSheet.Paste
ActiveSheet.Calculate
End Sub
I would also like to get rid of the direct reference [Range("A4").Copy].
On the Formulas sheet I would have a list of cell addresses needing to paste formulas and their relative formula would be placed in a cell next to it.
Then have the code automatically look on the Formulas sheet what needs to be pasted to which cell.
(Am I looking for too much?)
I can show a screenshot of what I mean.
if I understand correctly...
in sheet 1 column A you have cell names, in column B you have data.
you want to enter the data of column B in the cell (from column A) in sheet 2
if this is what you need , then here is the code
Sub paste_furmulas1()
Dim last_row As Long
last_row = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To last_row
Worksheets("TT Invoices").Range(Cells(i, 1)).Value = Cells(i, 2).Value
Next i
End Sub
It's a bit different.
In sheet 2 ("Formulas") cell A4 I have a formula, including another character in front of it to keep it as a value.
I want to place the formula without the extra character into sheet 1 ("TT Invoices") cell I2.
Then fill the formula all the way down till the end of the existing array.
Then change all of these formula results to values.
(For now, ignore the last paragraph in my original post.)
It's a bit different.
In sheet 2 ("Formulas") cell A4 I have a formula, including another character in front of it to keep it as a value.
I want to place the formula without the extra character into sheet 1 ("TT Invoices") cell I2.
Then fill the formula all the way down till the end of the existing array.
Then change all of these formula results to values.
(For now, ignore the last paragraph in my original post.)
It can be done very easy, I can send you the code later.
The question is.. If your using vba, you can have vba do the furmula instead of copy/paste.
It's a bit different.
In sheet 2 ("Formulas") cell A4 I have a formula, including another character in front of it to keep it as a value.
I want to place the formula without the extra character into sheet 1 ("TT Invoices") cell I2.
Then fill the formula all the way down till the end of the existing array.
Then change all of these formula results to values.
(For now, ignore the last paragraph in my original post.)
It can be done very easy, I can send you the code later.
The question is.. If your using vba, you can have vba do the furmula instead of copy/paste.
Sub paste_furmulas1()
Dim last_row As Long
last_row = Range("A" & Rows.Count).End(xlUp).Row
.value = mid(worksheets("formulas").range("a4"),2)
Range("i2:i" & last_row).copy
Range("i2:i" & last_row).pastespecial xlpastevalues
End Sub
1. I am doing the formulas on the fly while analyzing data and as you can see I am not experienced with VBA.
2. I am hoping to use this code for future projects. The VBA will be static and only the formulas will be custom to the project's needs.