rangea1.value

  1. A

    Get value from closed work book

    Hello everyone, Given Code getting values from closed workbook where extension is .xls. But now some file is .xlsx format. Where file extention is .xlsx this code not working. please give some idea how to open .xls and .xlsx files. Can we use OR Condition? Sub test() If Range("b1").Value =...
  2. gheyman

    code not doing what I intended

    Why is this not clearing the rows and why is it hiding column C? I am running it from a button on a different sheet Private Sub CommandButton2_Click() On Error Resume Next Sheets("ItemTemplate").Activate Rows("2:200").Clear Range("A1").Value = "UserId" Range("B1").Value...
  3. L

    swapping 2 selected cells/ranges -vba

    Hi I wrote a code to swap 2 cells. Can I swap 2 selected cells/ranges instead of hard coding the way I did it. Thank you so much Sub myswab() Dim tmp As Double tmp = Range("a1").Value Range("a1").Value = Range("b1").Value Range("b1").Value = tmp End Sub
  4. S

    input box

    Hi What am I doing wrong???? this works Sub box() Name = InputBox("name", 3) Range("A1").Value = name End Sub and this doesn't Sub box1() Name = InputBox("Start", 3) Range("A1").Value = Start End Sub mike
  5. K

    VBA to extract full decimal from percentage in cell

    Cell A1 = 29.7% <code> Dim PROF As Double PROF = Range("A1").value Range("B1") = PROF </code> B1 = .30 I want B1 to = .297 :banghead::banghead::banghead::banghead:
  6. E

    Excel 2007 Macro - Range or .Range

    Hi I am using Excel 2007. When searching the web for answers / tips to writing macros when referencing a range (single cell or several) I have seen both .Range("A1").Value = "" and Range("A1").Value = "" used. Can someone explain in simple terms what the difference is and when .Range or Range...
  7. GomaPile

    Move Shapes or Objects

    Hi All, Is there anyone who knows how to move shapes or objects in excel 2016 around a spreadsheet. The vba code below works fine, the shape moves back & forth Left to Right with Red Off | Green On. But I can't figure out how to move the shape Up & Down and keeping the Red Off | Green On as...
  8. J

    Macro or code to copy a "command button"

    As the title says, my need is to copy a made command button to another 500 rows. The code I'm using is this; Private Sub CommandButton1_Click() Dim x As Integer x = Range("A1").Value Range("A1").Value = x + 1 End Sub Which makes a count of how many times the button is clicked. What i...
  9. M

    Message box for multiple values

    Hi I want to adapt the below code so that if I entered a name from a choice of say 10 names it would bring up a message box with their managers name. The code below works for one name but how do i add to it? Sub manager() If Range("A1").Value = "Martin" Then MsgBox "Lee", Title:="Manager...
  10. S

    Vba learning

    below is my code which stops at the red word and gives compile error as shown below. [CODE][Sub inputbox() Dim myvalue As Variant myvalue = inputbox("Give me some input") Range("a1").Value = myvalue End Sub /CODE] Compile error: Wrong number of arguments or invalid property assignment
  11. T

    On Error GoTo 0

    In the sub below, should the On Error GoTo 0 be placed immediately after the line that might cause an error or should it be placed at the end, or indeed in both places? On Error GoTo Errhandler Worksheets("Sheet10").Activate 'On Error GoTo 0 'SHOULD THIS BE PLACED...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top