Posts by wxchic

    Re: VBA Set new IE tab as variable


    The code I've got for the username and password elements works. It will log in and submit my username and password correctly to each site. It will run thru each website I have and correctly login to each. The problem is each new site is overwriting the previous one in the same window, thus my need for tabs. I would like to reference each newly opened tab right after it opens and then perform the login.


    Code
    1. With IE
    2. .Visible = True
    3. .Navigate "www.2ndtab.com[/URL]",CLng(navOpenInNewTab)
    4. Do Until.ReadyState = 4
    5. DoEvents
    6. Loop


    How do I use this part/object that was just created below?


    Code
    1. .Navigate [URL="http://www.2ndtab.com/"]www.2ndtab.com[/URL]",CLngnavOpenInNewTab) = somevariable



    Then use:


    Code
    1. IE.somevariable.all.Item("userid").Value = cUsername
    2. IE.somevariable.all.Item("password").Value = cPassword
    3. IE.somevariable.forms(0).submit


    Can I reference the newly created tab, do the work on the said tab, then move on to next tab, etc.?

    I am opening an instance of IE thru Excel. I have several tabs that need to open after the first with each having their own login info. Each tab will be populated with the login info and subsequently logged in.


    It is opening a new tab, but getting hung up on this line: .Document.all.Item("username").Value = cUsername


    I suspect it doesn't like the .document.all.item that I have. Is there a way I can assign the new tab that is opened to a variable like,


    newesttab.all.item("userid").value = cUsername
    newesttab.all.item("password").value = cPassword


    Here is my code:



    Re: Drop down list


    That worked great. Is there any way to show that it is a drop down list even if you don't have the cell selected?
    And any way to always show the first cell in the range?


    Thanks for your help.

    Hello,


    I'm trying the create a drop down list in a cell. The list source is a range with 20 rows. All cells in the range may be populated. At times only a few will be populated. How do I get the drop down list to show only the cells that have data in them, not the zeros in the range?


    Also can I always have the first cell in the range show on the drop down list?


    Thanks for any help.

    Hello,


    I would like to compare and consolidate rows based on equal cells in the rows. Something like this:


    If
    (row1, columnC) = (row2, columnC) AND
    (row1, columnH) = (row2, columnH) AND
    (row1, columnK) = (row2, columnK) Then

    keep row1 columns A,B,C,E,G,H,J,K cells the same
    concatenate row1 and row2 columns D,F,I with "/"


    i.e. row1, columnD = CONCATENATE(row1,columnD), "/", (row2,columnD)


    If first condition is not met you can move down and compare the next 2 rows. I would like it to loop through several rows.


    If you get to empty row, exit.


    Thanks for any help.


    I tried to upload example file but got an error.

    I'm trying to set the print area in vba using a dynamic cell's row (firstbcity) and a static range of columns(A:AB). Problem is I don't know how to specifiy the range correctly. Something like:




    How do I write the Range correctly?


    Thanks for any help.

    Re: Find ActiveCell on another Sheet


    You're right, it is working. I changed the code to include the entire range of merged cells...this fixed my issue. I also fixed the issue of one cell being pasted by using Resize into the F9:AB11 range. Thanks for all your help.

    Re: Find ActiveCell on another Sheet


    Good, that is what I want it to do. The user will be selecting a cell (variable) and searching for that value on another sheet. Should I activate the sheet they are on in the code even though they will have to be on that sheet since that is where the button will be? Or is it possible to add code to a worksheet instead of in module?

    I'm trying to use the code below to find the ActiveCell on Worksheet("FORECAST") in non contiguous range on Worksheet("PUBLISH FORECAST") and do some cuttin and pastin. I think it is getting hung up on the fact that they are different sheets. It works if I search for activecell on same sheet. Any help would be fantastic. Thanks!


    Re: Worksheet Change Malfunction


    Yup I tried that and Im getting the "no cells found" error...as stated in post #6 above. I'm not sure exactly what this line is stating:


    Code
    1. Target.Address <> "$B$5" Then Exit


    If someone changes B5 and hits enter, theoretically the address is now B6. So will it Exit the macro?

    I am using the code below to search a non-contiguous range for empty cells. If found, I am pasting into foundempty cell and pasting into offset of this foundempty. For some reason it will not paste in my first cell in range (B10). It works fine in the next foundempty in selected range. Any ideas?


    Re: Worksheet Change Malfunction


    I am getting error when trying to upload example. Basically the cell(b5) being changed is a city. When a new city is put in, macros fetch the runways. These runways are then used on a line graph/chart. I have 16 rows sets up to receive runways. If an input city only has 4 runways I want to hide the empty rows so they are not shown on line graph/chart. I also need them to unhide each time before to allow for the possibility of all 16 rows being used.


    I had it working, but it was also running when other macros would run on this page. I only want it ran when B5(city) is changed.

    Re: Worksheet Change Malfunction


    The value of B5 is text. No need to evaluate. I only care if it is changed in any way. Here is the code I modified. I am getting an 'NO CELLS WERE FOUND' error when running now. Any ideas? Basically I need the range (B224:B239) to hide or unhide based on changing B5 changing.


    Hello,


    I'm using the crude code below to hide/unhide a range when cell B5 is changed. It works fine until I run another macro on the page. Then it unhides my rows, which I don't want. My question is, Is there a way to run this macro only when the cell B5 changes and nothing else?


    Thanks.



    Re: Find Blank in non contiguous range


    I'm testing this one, but somehow I need publishText = forecastText. Similar to copy paste. I'm not sure I need to name a range for publishText since it will be an offset location. But what is being pasted into this location is forecastText. Hope this makes sense.