Skip to content

Instantly share code, notes, and snippets.

@erajanraja24
erajanraja24 / ReadExcelCell.java
Last active February 10, 2016 09:42
How to read data from excel cell using Apache POI in java
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class writeexcel {
@erajanraja24
erajanraja24 / gist:095acc8883e56bbf0439
Created February 14, 2016 18:04
Getting the product details
Sub asinfetch()
Dim driver As New FirefoxDriver
driver.Get "http://www.amazon.com/gp/product/B00MFY3GB4", 20000
driver.Window.Maximize
Set proe = driver.FindElementById("detail-bullets")
Set cla = proe.FindElementByClass("content")
Set li = cla.FindElementsByTag("li")
@erajanraja24
erajanraja24 / test
Created February 15, 2016 18:34
Matrix form
Sub check()
Dim i As Integer, j As Integer, k As Integer, l As Integer, m As Integer, n As Integer, o As Integer
Dim count()
cnt = 0
lrow = ThisWorkbook.Sheets(1).Range("A65536").End(xlUp).Row
lcol = ThisWorkbook.Sheets(1).Cells(1, Columns.count).End(xlToLeft).Column
p = ThisWorkbook.Sheets(2).Range("A65536").End(xlUp).Row
q = ThisWorkbook.Sheets(2).Cells(1, Columns.count).End(xlToLeft).Column
@erajanraja24
erajanraja24 / Amazon product tracker
Last active February 26, 2016 13:59
Amazon Products tracker
Title-Done
Brand-Done
List Price
price
Sale price
Availability-Done
Merchant info-Done
Fullfilled by amazon?-Done
About the product-Done
Product description-Done
@erajanraja24
erajanraja24 / Copy image on the same sheet
Created March 13, 2016 13:53
Copy Image from one cell to another cell on the same sheet
Sub copyimage1()
'Activate the sheet 1
ThisWorkbook.Sheets(1).Activate
'Select Range A1
ThisWorkbook.Sheets(1).Range("A1").Select
'Copy the image and all other values
Selection.Copy
'Select the target cell D6
ThisWorkbook.Sheets(1).Range("D6").Select
@erajanraja24
erajanraja24 / Copy paste Images from one cell to another cell on different sheet
Created March 13, 2016 14:03
Copy paste Images from one cell to another cell on different sheet
Sub copyimage2()
'Activate the sheet 1
ThisWorkbook.Sheets(1).Activate
'Select Range A1
ThisWorkbook.Sheets(1).Range("A1").Select
'Copy the image and all other values
Selection.Copy
@erajanraja24
erajanraja24 / How to Speed up Excel VBA macro by adding two functions?
Created March 15, 2016 17:25
How to Speed up Excel VBA macro by adding two functions?
Sub normalspeed()
Dim StartTime As Double
Dim SecondsElapsed As Double
'Timer Begins
StartTime = Timer
For i = 1 To 100
For j = 1 To 100
@erajanraja24
erajanraja24 / Selenium in Excel VBA
Created April 10, 2016 09:36
Selenium in Excel VBA
Sub check()
'Initialize the Firfox Driver
Dim driver As New FirefoxDriver
'Navigate to Google web page
driver.Get ("https://www.google.co.in")
'Maximize the Firefox driver
driver.Window.Maximize
End Sub
@erajanraja24
erajanraja24 / Autoit in Excel VBA
Created April 11, 2016 16:26
Autoit in Excel VBA
Sub autoit()
'Create and initialize an object
Dim autoit As AutoItX3
Set autoit = New AutoItX3
'Check autoit installation
If IsNull(autoit) Then
MsgBox "Autoit Is Not installed on your machine", vbCritical + vbOKOnly, "Verify"
@erajanraja24
erajanraja24 / Excel VBA macro to delete rows based on condition
Created April 13, 2016 19:23
Excel VBA macro to delete rows based on condition
Sub deleterowsvba()
Dim lrow As Integer, i As Integer
'Determine the last row of column A in sheet 1
lrow = ThisWorkbook.Sheets(1).Range("A65356").End(xlUp).Row
'Find and delete the rows which contain property 2 starting from the last column
For i = lrow To 2 Step -1
If ThisWorkbook.Sheets(1).Cells(i, 2) = 2 Then